未验证 提交 82d8892b 编写于 作者: S songzhibin97 提交者: GitHub

feat:明确root语义 (#740)

feat:明确root语义 (#740)
上级 dfba1f21
......@@ -72,6 +72,8 @@ local:
# autocode configuration
autocode:
transfer-restart: true
# root 自动适配项目根目录
# 请不要手动配置,他会在项目加载的时候识别出根路径
root: ""
server: /server
server-api: /api/v1/autocode
......
......@@ -56,9 +56,11 @@ 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)),
)
)
return v
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册