修复重定向

pull/79/head^2
zhangchenhao 2025-05-08 16:15:34 +08:00
parent a89e77f559
commit 4c196c8dbf
1 changed files with 1 additions and 4 deletions

View File

@ -36,9 +36,6 @@ func SessionAuthMiddleware() gin.HandlerFunc {
// 一定要保存 session BEFORE redirect
session.Save()
}
if paths[0] == "login" || paths[0] == "home" {
return
}
// 返回登录页
c.Redirect(http.StatusFound, "/login")
// c.Abort()
@ -100,7 +97,7 @@ func SessionAuthMiddleware() gin.HandlerFunc {
session.Set("lastRequestTime", now)
session.Save()
if paths[0] == "login" {
c.Redirect(http.StatusFound, "/home")
c.Redirect(http.StatusFound, "/")
c.Abort()
return
}