Browse Source

fix:edit gpt user login

jimmyyem 2 months ago
parent
commit
1b3c1f2ebd
1 changed files with 7 additions and 0 deletions
  1. 7 0
      internal/logic/User/do_gpts_user_login_logic.go

+ 7 - 0
internal/logic/User/do_gpts_user_login_logic.go

@@ -35,6 +35,13 @@ func (l *DoGptsUserLoginLogic) DoGptsUserLogin(req *types.GptsUserLoginReq) (res
 			Username: *req.Username,
 		})
 
+	if err != nil {
+		return nil, errorx.NewCodeInvalidArgumentError("用户名或密码错误")
+	}
+	if user == nil {
+		return nil, errorx.NewCodeInvalidArgumentError("用户名或密码错误")
+	}
+
 	if user.Status != nil && *user.Status != uint32(utils.StatusNormal) {
 		return nil, errorx.NewCodeInvalidArgumentError("login.userBanned")
 	}