浏览代码

修改登录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 {