fix typo (#1004)
* 修改拼写错误 修改拼写错误 exsits -> exists * Update router_login.go
This commit is contained in:
parent
540ef68dc8
commit
90dacd0085
|
@ -143,8 +143,8 @@ func refreshPost(c *gin.Context) {
|
||||||
func loginRedirect(c *gin.Context) {
|
func loginRedirect(c *gin.Context) {
|
||||||
redirect := ginx.QueryStr(c, "redirect", "/")
|
redirect := ginx.QueryStr(c, "redirect", "/")
|
||||||
|
|
||||||
v, exsits := c.Get("userid")
|
v, exists := c.Get("userid")
|
||||||
if exsits {
|
if exists {
|
||||||
userid := v.(int64)
|
userid := v.(int64)
|
||||||
user, err := models.UserGetById(userid)
|
user, err := models.UserGetById(userid)
|
||||||
ginx.Dangerous(err)
|
ginx.Dangerous(err)
|
||||||
|
@ -152,7 +152,7 @@ func loginRedirect(c *gin.Context) {
|
||||||
ginx.Bomb(200, "user not found")
|
ginx.Bomb(200, "user not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
if user.Username != "" { // alread login
|
if user.Username != "" { // already login
|
||||||
ginx.NewRender(c).Data(redirect, nil)
|
ginx.NewRender(c).Data(redirect, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue