开始新增代码生成配置2.0功能,配置文件格式规定完成

This commit is contained in:
hoteas
2021-09-16 04:33:10 +08:00
parent acb7cdd4b8
commit 9513b80a24
10 changed files with 131 additions and 1326 deletions
+4 -4
View File
@@ -303,7 +303,7 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) {
http.SetCookie(w, &http.Cookie{Name: that.Config.GetString("sessionName"), Value: sessionId, Path: "/"})
} else {
//跨域允许需要设置cookie的允许跨域https才有效果
w.Header().Set("Set-Cookie", that.Config.GetString("sessionName")+"="+sessionId+"; SameSite=None; Secure")
w.Header().Set("Set-Cookie", that.Config.GetString("sessionName")+"="+sessionId+"; Path=/; SameSite=None; Secure")
}
} else {
sessionId = cookie.Value
@@ -459,11 +459,11 @@ func Init(config string) Application {
appIns.SetCache()
appIns.MakeCode = &code.MakeCode{}
codeConfig := appIns.Config.GetMap("codeConfig")
if codeConfig != nil {
if codeConfig != nil {
for k, _ := range codeConfig {
if appIns.Config.GetInt("mode") == 2{
if appIns.Config.GetInt("mode") == 2 {
appIns.MakeCode.Db2JSON(k, codeConfig.GetString(k), &appIns.Db)
}else{
} else {
appIns.MakeCode.Db2JSON(k, codeConfig.GetString(k), nil)
}
}