开发环境允许设置cookie

This commit is contained in:
piexlMax(奇淼
2024-01-18 13:08:14 +08:00
parent d849df41be
commit 5ca47a91a6
2 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ func ClearToken(c *gin.Context) {
if err != nil {
host = c.Request.Host
}
c.SetCookie("x-token", "", -1, "/", host, false, false)
c.SetCookie("x-token", "", -1, "/", host, true, false)
}
func SetToken(c *gin.Context, token string, maxAge int) {
@@ -23,7 +23,7 @@ func SetToken(c *gin.Context, token string, maxAge int) {
if err != nil {
host = c.Request.Host
}
c.SetCookie("x-token", token, maxAge, "/", host, false, false)
c.SetCookie("x-token", token, maxAge, "/", host, true, false)
}
func GetToken(c *gin.Context) string {