This commit is contained in:
2021-09-12 05:35:14 +08:00
parent 62cf625fe9
commit 9c3ba81135
20 changed files with 36 additions and 63 deletions
+7 -3
View File
@@ -302,7 +302,7 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) {
if that.Config.GetString("crossDomain") == "" {
http.SetCookie(w, &http.Cookie{Name: that.Config.GetString("sessionName"), Value: sessionId, Path: "/"})
} else {
//跨域允许需要设置cookie的允许跨域
//跨域允许需要设置cookie的允许跨域https才有效果
w.Header().Set("Set-Cookie", that.Config.GetString("sessionName")+"="+sessionId+"; SameSite=None; Secure")
}
} else {
@@ -459,9 +459,13 @@ func Init(config string) Application {
appIns.SetCache()
appIns.MakeCode = &code.MakeCode{}
codeConfig := appIns.Config.GetMap("codeConfig")
if codeConfig != nil && appIns.Config.GetInt("mode") == 2 {
if codeConfig != nil {
for k, _ := range codeConfig {
appIns.MakeCode.Db2JSON(k, codeConfig.GetString(k), appIns.Db)
if appIns.Config.GetInt("mode") == 2{
appIns.MakeCode.Db2JSON(k, codeConfig.GetString(k), &appIns.Db)
}else{
appIns.MakeCode.Db2JSON(k, codeConfig.GetString(k), nil)
}
}
}