Browse Source

Merge branch 'CRM_12.9'

ziwen 1 year ago
parent
commit
50a9aad382
2 changed files with 6 additions and 1 deletions
  1. 1 1
      controller/auth.go
  2. 5 0
      middleware/token.go

+ 1 - 1
controller/auth.go

@@ -271,7 +271,7 @@ func (a *AuthController) GetSmsCode(c *gin.Context) {
 		if errMsg != "" {
 			errMsg = "获取验证码失败"
 		}
-		resp.Fail(errMsg, c)
+		resp.Fail("mobile phone number format is wrong.", c)
 		return
 	}
 

+ 5 - 0
middleware/token.go

@@ -48,6 +48,11 @@ func Token() gin.HandlerFunc {
 			c.Abort()
 			return
 		}
+		if userEmail.Enable == 0 || userEmail.Status == 3 {
+			resp.TokenError(nil, "User disabled", "User disabled", c)
+			c.Abort()
+			return
+		}
 		userInfo := services.UserInfo{
 			Email:      *userEmail,
 		}