We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9dc7817 commit d4914d6Copy full SHA for d4914d6
server/config.yaml
@@ -72,6 +72,8 @@ local:
72
# autocode configuration
73
autocode:
74
transfer-restart: true
75
+ # root 自动适配项目根目录
76
+ # 请不要手动配置,他会在项目加载的时候识别出根路径
77
root: ""
78
server: /server
79
server-api: /api/v1/autocode
server/core/viper.go
@@ -56,9 +56,11 @@ func Viper(path ...string) *viper.Viper {
56
if err := v.Unmarshal(&global.GVA_CONFIG); err != nil {
57
fmt.Println(err)
58
}
59
+ // root 适配性
60
+ // 根据root位置去找到对应迁移位置,保证root路径有效
61
global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..")
62
global.BlackCache = local_cache.NewCache(
63
local_cache.SetDefaultExpire(time.Second * time.Duration(global.GVA_CONFIG.JWT.ExpiresTime)),
- )
64
+ )
65
return v
66
0 commit comments