zoujiajian 3 năm trước cách đây
mục cha
commit
3db0e0b9df

+ 3 - 3
netflix-service/src/main/java/com/cyksj/service/cps/impl/CpsManageServiceImpl.java

@@ -63,7 +63,7 @@ public class CpsManageServiceImpl implements CpsManageService {
 		}
 		String code = StringUtil.getRandomCodeStr(6);
 		if (type == 1) {
-			if (!Validator.isMobile(login)) {
+			if (StrUtil.isEmpty(login)) {
 				throw BusinessRuntimeException.getInstance("请输入正确的手机号");
 			}
 			SmsUtil.sendTencent(cid, login, code);
@@ -93,13 +93,13 @@ public class CpsManageServiceImpl implements CpsManageService {
 		}
 		String CACHE_LOGIN_KEY = RedisService.key.CPS_BACK_LOGIN_KEY.getName();
 		if (type == 1) {
-			if (!Validator.isMobile(phone)) {
+			if (StrUtil.isEmpty(phone)) {
 				throw BusinessRuntimeException.getInstance("请输入正确的手机号");
 			}
 			CACHE_LOGIN_KEY += phone;
 		} else if (type == 2) {
 			if (!Validator.isEmail(email)) {
-				throw BusinessRuntimeException.getInstance("请输入正确的手机号");
+				throw BusinessRuntimeException.getInstance("请输入正确的邮箱");
 			}
 			CACHE_LOGIN_KEY += email;
 		}

+ 1 - 2
netflix-service/src/main/java/com/cyksj/service/gzh/factory/EventMsgService.java

@@ -1,6 +1,5 @@
 package com.cyksj.service.gzh.factory;
 
-import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -245,7 +244,7 @@ public class EventMsgService implements GzhMsgService {
 	}
 
 	public void userBind(Long userId, String sceneKey, String loginPhone) {
-		if (StrUtil.isNotBlank(loginPhone) && Validator.isMobile(loginPhone)) {
+		if (StrUtil.isNotBlank(loginPhone)) {
 			log.info("pc端用户phone:{}购买车票后,微信扫描公众号二维码进行用户信息绑定", loginPhone);
 			try {
 				bindTaskService.bindPhone(userId, loginPhone, null, false);

+ 1 - 2
netflix-service/src/main/java/com/cyksj/service/phone/impl/PhoneCodeServiceImpl.java

@@ -2,7 +2,6 @@ package com.cyksj.service.phone.impl;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.common.exception.BusinessRuntimeException;
@@ -29,7 +28,7 @@ public class PhoneCodeServiceImpl implements PhoneCodeService {
 
 	@Override
 	public void checkPhone(String phone, String code) {
-		if (!Validator.isMobile(phone)) {
+		if (StrUtil.isEmpty(phone)) {
 			throw BusinessRuntimeException.getInstance("请输入正确的手机号码");
 		}
 		DateTime now = DateTime.now();

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -318,8 +318,8 @@ public class AuthorizationController {
     @GetMapping("/get/phone/code")
     @NoSubmit
     public Result<String> getPhoneCode(String phone, Integer digit, @RequestParam(defaultValue = "0") Boolean isFree, Integer cid) {
-        if (StrUtil.isBlank(phone) || !Validator.isMobile(phone)) {
-            throw BusinessRuntimeException.getInstance("请输入正确手机号");
+        if (StrUtil.isBlank(phone)) {
+            throw BusinessRuntimeException.getInstance("请输入正确手机号");
         }
         if (cid == null) cid = 86;
         PhoneCode phoneCode = phoneCodeMapper.selectOne(Wrappers.lambdaQuery(PhoneCode.class).eq(PhoneCode::getPhone, phone).last("limit 1"));