mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-11 09:11:10 +08:00
修复重定向
This commit is contained in:
@@ -36,9 +36,6 @@ func SessionAuthMiddleware() gin.HandlerFunc {
|
|||||||
// 一定要保存 session BEFORE redirect
|
// 一定要保存 session BEFORE redirect
|
||||||
session.Save()
|
session.Save()
|
||||||
}
|
}
|
||||||
if paths[0] == "login" || paths[0] == "home" {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 返回登录页
|
// 返回登录页
|
||||||
c.Redirect(http.StatusFound, "/login")
|
c.Redirect(http.StatusFound, "/login")
|
||||||
// c.Abort()
|
// c.Abort()
|
||||||
@@ -100,7 +97,7 @@ func SessionAuthMiddleware() gin.HandlerFunc {
|
|||||||
session.Set("lastRequestTime", now)
|
session.Set("lastRequestTime", now)
|
||||||
session.Save()
|
session.Save()
|
||||||
if paths[0] == "login" {
|
if paths[0] == "login" {
|
||||||
c.Redirect(http.StatusFound, "/home")
|
c.Redirect(http.StatusFound, "/")
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user