songzhibin97
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
1 deletions
-
server/config.yaml
-
server/core/viper.go
|
|
@ -72,6 +72,8 @@ local: |
|
|
|
# autocode configuration |
|
|
|
autocode: |
|
|
|
transfer-restart: true |
|
|
|
# root 自动适配项目根目录 |
|
|
|
# 请不要手动配置,他会在项目加载的时候识别出根路径 |
|
|
|
root: "" |
|
|
|
server: /server |
|
|
|
server-api: /api/v1/autocode |
|
|
|
|
|
@ -56,6 +56,8 @@ func Viper(path ...string) *viper.Viper { |
|
|
|
if err := v.Unmarshal(&global.GVA_CONFIG); err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
} |
|
|
|
// root 适配性
|
|
|
|
// 根据root位置去找到对应迁移位置,保证root路径有效
|
|
|
|
global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..") |
|
|
|
global.BlackCache = local_cache.NewCache( |
|
|
|
local_cache.SetDefaultExpire(time.Second * time.Duration(global.GVA_CONFIG.JWT.ExpiresTime)), |
|
|
|