ソースを参照

修改登录bug

genlong 7 ヶ月 前
コミット
c0619c640a
1 ファイル変更2 行追加3 行削除
  1. 2 3
      service/auth/auth_service.go

+ 2 - 3
service/auth/auth_service.go

@@ -208,8 +208,7 @@ func RefreshToken(code string) (token string, isBindMobile int, err error) {
 
 		//判断unionid是否存在
 		wxUser, unionErr := userService.GetTemplateUserByUnionId(wechatInfo.UnionId)
-
-		if unionErr == nil {
+		if unionErr != nil {
 			if unionErr == gorm.ErrRecordNotFound { //注册用户
 				isRegister = true
 			} else {
@@ -342,7 +341,7 @@ func BindWxGzh(code string) (err error) {
 		//判断unionid是否存在
 		wxUser, unionErr := userService.GetTemplateUserByUnionId(unionId)
 
-		if unionErr == nil {
+		if unionErr != nil {
 			if unionErr == gorm.ErrRecordNotFound { //注册用户
 				isRegister = true
 			} else {