chao 4 年之前
父节点
当前提交
1373909cb8

+ 1 - 1
src/main/java/com/caimei365/user/service/impl/BaseServiceImpl.java

@@ -116,7 +116,7 @@ public class BaseServiceImpl implements BaseService {
                 // 找回密码
                 sendFlag = AliyunSmsUtil.sendSms(mobile, 1, "{code:" + randomCode + "}");
             } else {
-                if (userId > 0) {
+                if (null != userId && userId > 0) {
                     return ResponseJson.error("该手机号已被使用");
                 }
                 if ("2".equals(activateCodeType)) {

+ 1 - 1
src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java

@@ -161,7 +161,7 @@ public class LoginServiceImpl implements LoginService {
                 if (mode == 1) {
                     // 静默授权
                     Integer userId = loginMapper.getUserIdByOpenId(openId, "www");
-                    if (userId > 0) {
+                    if (null != userId && userId > 0) {
                         UserLoginVo user = loginMapper.getLoginUserByUserId(userId);
                         // 返回登录用户
                         return logonVerify(user);

+ 2 - 2
src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java

@@ -84,12 +84,12 @@ public class RegisterServiceImpl implements RegisterService {
         }
         // 查找用户表是否存在
         Integer dbUserId = baseMapper.getUserIdByMobile(clubRegisterDto.getBindMobile());
-        if (dbUserId > 0) {
+        if (null != dbUserId && dbUserId > 0) {
             return ResponseJson.error("该手机号已被使用", null);
         }
         // 查找运营人员表是否存在
         Integer dbOperationId = baseMapper.getOperationIdByMobile(clubRegisterDto.getBindMobile());
-        if (dbOperationId > 0) {
+        if (null != dbOperationId && dbOperationId > 0) {
             return ResponseJson.error("您已是机构运营人员,无需再注册机构", null);
         }
         /*

+ 6 - 6
src/main/java/com/caimei365/user/service/impl/ShopServiceImpl.java

@@ -85,12 +85,12 @@ public class ShopServiceImpl implements ShopService {
         }
         // 查找用户表是否存在
         Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
-        if (dbUserId > 0) {
+        if (null != dbUserId && dbUserId > 0) {
             return ResponseJson.error("该手机号已被使用", null);
         }
         // 查找运营人员表是否存在
         Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
-        if (dbOperationId > 0) {
+        if (null != dbOperationId && dbOperationId > 0) {
             return ResponseJson.error("您已是机构运营人员,无需再注册机构", null);
         }
         String redisSmsCode = (String) redisService.get("code:" + bindMobile);
@@ -99,7 +99,7 @@ public class ShopServiceImpl implements ShopService {
         }
         if (StringUtils.isNotBlank(email)) {
             dbUserId = baseMapper.getUserIdByEmail(email);
-            if (dbUserId > 0) {
+            if (null != dbUserId && dbUserId > 0) {
                 return ResponseJson.error("该邮箱已被使用", null);
             }
         }
@@ -235,12 +235,12 @@ public class ShopServiceImpl implements ShopService {
             }
             // 查找用户表是否存在
             Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
-            if (dbUserId > 0) {
+            if (null != dbUserId && dbUserId > 0) {
                 return ResponseJson.error("该手机号已被使用", null);
             }
             // 查找运营人员表是否存在
             Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
-            if (dbOperationId > 0) {
+            if (null != dbOperationId && dbOperationId > 0) {
                 return ResponseJson.error("您已是机构运营人员,无需再注册机构", null);
             }
             String redisSmsCode = (String) redisService.get("code:" + bindMobile);
@@ -255,7 +255,7 @@ public class ShopServiceImpl implements ShopService {
             if (StringUtils.isNotBlank(email)) {
                 // 查找用户表是否存在相同邮箱
                 Integer dbUserId = baseMapper.getUserIdByEmail(email);
-                if (dbUserId > 0) {
+                if (null != dbUserId && dbUserId > 0) {
                     return ResponseJson.error("该邮箱已被使用", null);
                 }
             }