开始新增代码生成配置2.0功能,配置文件格式规定完成
This commit is contained in:
parent
9cd7ad34b3
commit
47b28e7b57
@ -298,9 +298,13 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) {
|
|||||||
if len(token) == 32 {
|
if len(token) == 32 {
|
||||||
sessionId = token
|
sessionId = token
|
||||||
}
|
}
|
||||||
//http.SetCookie(w, &http.Cookie{Name: that.Config.GetString("sessionName"), Value: sessionId+";SameSite=Strict", Path: "/"})
|
//没有跨域设置
|
||||||
//http.SetCookie(w, &http.Cookie{Name: "SameSite", Value: "Strict", Path: "/"})
|
if that.Config.GetString("crossDomain") == "" {
|
||||||
|
http.SetCookie(w, &http.Cookie{Name: that.Config.GetString("sessionName"), Value: sessionId, Path: "/"})
|
||||||
|
} else {
|
||||||
|
//跨域允许需要设置cookie的允许跨域
|
||||||
w.Header().Set("Set-Cookie", that.Config.GetString("sessionName")+"="+sessionId+"; SameSite=None; Secure")
|
w.Header().Set("Set-Cookie", that.Config.GetString("sessionName")+"="+sessionId+"; SameSite=None; Secure")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sessionId = cookie.Value
|
sessionId = cookie.Value
|
||||||
}
|
}
|
||||||
|
7
var.go
7
var.go
@ -14,6 +14,13 @@ var Config = Map{
|
|||||||
"codeConfig": Map{
|
"codeConfig": Map{
|
||||||
"admin": "config/app.json",
|
"admin": "config/app.json",
|
||||||
},
|
},
|
||||||
|
"codeConfig1": Map{
|
||||||
|
"admin": Map{ //默认无,必须,接口类别名称
|
||||||
|
"package": "admin", //默认admin,非必须,有则生成代码到此目录,无则采用缺省模式不生成代码只生成接口
|
||||||
|
"config": "config/app.json", //默认config/app.json,必须,接口描述配置文件
|
||||||
|
"rule": "config/rule.json", //默认config/rule.json,非必须,有则按改规则生成接口,无则按系统内嵌方式生成
|
||||||
|
},
|
||||||
|
},
|
||||||
"db": Map{
|
"db": Map{
|
||||||
"sqlite": Map{
|
"sqlite": Map{
|
||||||
"path": "config/data.db",
|
"path": "config/data.db",
|
||||||
|
Loading…
Reference in New Issue
Block a user