* 修改拼写错误

修改拼写错误
exsits -> exists

* Update router_login.go
This commit is contained in:
Henry Chia 2022-06-29 19:08:58 +08:00 committed by GitHub
parent 540ef68dc8
commit 90dacd0085
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -143,8 +143,8 @@ func refreshPost(c *gin.Context) {
func loginRedirect(c *gin.Context) {
redirect := ginx.QueryStr(c, "redirect", "/")
v, exsits := c.Get("userid")
if exsits {
v, exists := c.Get("userid")
if exists {
userid := v.(int64)
user, err := models.UserGetById(userid)
ginx.Dangerous(err)
@ -152,7 +152,7 @@ func loginRedirect(c *gin.Context) {
ginx.Bomb(200, "user not found")
}
if user.Username != "" { // alread login
if user.Username != "" { // already login
ginx.NewRender(c).Data(redirect, nil)
return
}