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 {