Browse Source

:art: 访问授权重定向

Liang Ding 2 years ago
parent
commit
0a08db69ae
1 changed files with 6 additions and 0 deletions
  1. 6 0
      kernel/model/session.go

+ 6 - 0
kernel/model/session.go

@@ -228,5 +228,11 @@ func CheckAuth(c *gin.Context) {
 		return
 	}
 
+	if u := c.Query("url"); "" != u {
+		c.Redirect(302, u)
+		c.Abort()
+		return
+	}
+
 	c.Next()
 }