修复验证码cookie

pull/79/head^2
zhangchenhao 2025-05-15 17:45:00 +08:00
parent 68213f47f6
commit 055f835eb3
2 changed files with 14 additions and 11 deletions

View File

@ -99,7 +99,7 @@ func Sign(c *gin.Context) {
_ = session.Save() _ = session.Save()
// c.JSON(http.StatusBadRequest, public.ResERR("用户不存在")) // c.JSON(http.StatusBadRequest, public.ResERR("用户不存在"))
// 设置cookie // 设置cookie
c.SetCookie("must_code", "1", 0, "/", "", false, true) c.SetCookie("must_code", "1", 0, "/", "", false, false)
public.FailMsg(c, "用户不存在") public.FailMsg(c, "用户不存在")
return return
} }
@ -137,7 +137,7 @@ func Sign(c *gin.Context) {
_ = session.Save() _ = session.Save()
// c.JSON(http.StatusOK, public.ResOK(0, nil, "登录成功")) // c.JSON(http.StatusOK, public.ResOK(0, nil, "登录成功"))
// 设置cookie // 设置cookie
c.SetCookie("must_code", "1", -1, "/", "", false, true) c.SetCookie("must_code", "1", -1, "/", "", false, false)
public.SuccessMsg(c, "登录成功") public.SuccessMsg(c, "登录成功")
return return
} }

View File

@ -237,6 +237,9 @@ INSERT INTO settings (key, value, create_time, update_time, active, type) VALUES
InsertIfNotExists(db, "access_type", map[string]any{"name": "baidu", "type": "dns"}, []string{"name", "type"}, []any{"baidu", "dns"}) InsertIfNotExists(db, "access_type", map[string]any{"name": "baidu", "type": "dns"}, []string{"name", "type"}, []any{"baidu", "dns"})
InsertIfNotExists(db, "access_type", map[string]any{"name": "btwaf", "type": "host"}, []string{"name", "type"}, []any{"btwaf", "host"}) InsertIfNotExists(db, "access_type", map[string]any{"name": "btwaf", "type": "host"}, []string{"name", "type"}, []any{"btwaf", "host"})
InsertIfNotExists(db, "access_type", map[string]any{"name": "safeline", "type": "dns"}, []string{"name", "type"}, []any{"safeline", "host"})
} }
func insertDefaultData(db *sql.DB, table, insertSQL string) { func insertDefaultData(db *sql.DB, table, insertSQL string) {