zhoutg 6 years ago
parent
commit
d9259c9a25

+ 10 - 10
user-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -342,11 +342,11 @@ public class UserFacade extends UserServiceImpl {
         JwtDTO data = new JwtDTO();
         if (StringUtil.isBlank(username)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "请输入手机号!");
+                    "请输入手机号");
         }
         if (StringUtil.isBlank(password)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "请输入密码!");
+                    "请输入密码");
         }
         User user = this.findByName(username);
         if (null == user) {
@@ -377,7 +377,7 @@ public class UserFacade extends UserServiceImpl {
         JwtDTO data = new JwtDTO();
         if (StringUtil.isBlank(refreshToken)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "刷新令牌不能为空!");
+                    "刷新令牌不能为空");
         }
 
         JWT jwt = authServiceClient.refreshToken("Basic dWFhLXNlcnZpY2U6MTIzNDU2", "refresh_token", refreshToken);
@@ -399,7 +399,7 @@ public class UserFacade extends UserServiceImpl {
     public OAuth2AccessToken checkToken(String token) {
         if (StringUtil.isBlank(token)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "令牌不能为空!");
+                    "令牌不能为空");
         }
 
         OAuth2AccessToken jwt = authServiceClient.checkToken("Basic dWFhLXNlcnZpY2U6MTIzNDU2", token);
@@ -487,11 +487,11 @@ public class UserFacade extends UserServiceImpl {
     public RespDTO resetPassword(String username, String password, String diffPassword) {
         if (StringUtil.isBlank(username)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "请输入手机号!");
+                    "请输入手机号");
         }
         if (StringUtil.isBlank(password)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "请输入密码!");
+                    "请输入密码");
         }
         User user = this.findByName(username);
         if (null == user) {
@@ -500,7 +500,7 @@ public class UserFacade extends UserServiceImpl {
         PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
         if (!StringUtil.isBlank(diffPassword) && "Y".equals(diffPassword)) {
             if (passwordEncoder.matches(password, user.getPassword())) {
-                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "修改后密码不能与修改前相同!");
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "修改后密码不能与修改前相同");
             }
         }
         String entryPassword = passwordEncoder.encode(password);
@@ -521,15 +521,15 @@ public class UserFacade extends UserServiceImpl {
     public Boolean modifyPassword(String password, String modifyPassword) {
         if (StringUtil.isBlank(password)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "请输入密码!");
+                    "请输入密码");
         }
         if (StringUtil.isBlank(modifyPassword)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "请输入新密码!");
+                    "请输入新密码");
         }
         if(password.equals(modifyPassword)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "原密码和新密码不能相同!");
+                    "原密码和新密码不能相同");
         }
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         User user = this.getById(userId);

+ 3 - 3
user-service/src/main/java/com/diagbot/facade/VerFacade.java

@@ -216,10 +216,10 @@ public class VerFacade {
         //        if (imgVerRes){
         //            User bean = userFacade.getUserInfo(smsVerVerVO.getMobile());
         //            if (bean != null){
-        //                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "该号码已经被注册!");
+        //                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "该号码已经被注册");
         //            }
         //        } else {
-        //            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "输入图形验证码有误!");
+        //            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "输入图形验证码有误");
         //        }
         //验证用户短信信息
         SwsVerInfo swsVerInfo = new SwsVerInfo();
@@ -227,7 +227,7 @@ public class VerFacade {
         swsVerInfo.setCode(smsVerVerVO.getSmsCode());
         Boolean smsVer = smsVerService.verifySmsVerification(swsVerInfo);
         if (!smsVer) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "短信验证码输入有误,请重新输入!");
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "短信验证码输入有误,请重新输入");
         }
         return true;
     }

+ 10 - 10
user-service/src/main/java/com/diagbot/service/impl/ImgVerServiceImpl.java

@@ -59,11 +59,11 @@ public class ImgVerServiceImpl implements ImgVerService {
     public byte[] createImgVerification(ImgVerInfo imgVerInfo) {
         if (null == imgVerInfo) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "用户图片验证信息不能为空!");
+                    "用户图片验证信息不能为空");
         }
         if (StringUtil.isBlank(imgVerInfo.getImgId())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "图片验证码唯一标志不能为空!");
+                    "图片验证码唯一标志不能为空");
         }
         //生成图片验证码
         Object[] obj = VerifyCodeUtils.createImage();
@@ -101,15 +101,15 @@ public class ImgVerServiceImpl implements ImgVerService {
     public Boolean verifyImgVerification(ImgVerInfo imgVerInfo) {
         if (null == imgVerInfo) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "用户图片验证信息不能为空!");
+                    "用户图片验证信息不能为空");
         }
         if (StringUtil.isBlank(imgVerInfo.getImgId())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "图片验证码唯一标志不能为空!");
+                    "图片验证码唯一标志不能为空");
         }
         if (StringUtil.isBlank(imgVerInfo.getCode())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "验证码不能为空!");
+                    "验证码不能为空");
         }
         //从redis中取出
         final byte[] redis_key = getUserImgKey(imgVerInfo.getImgId());
@@ -124,26 +124,26 @@ public class ImgVerServiceImpl implements ImgVerService {
             }
         });
         if (imgVerInfoRes == null) {
-            log.info("用户图片验证信息不存在【imgId=" + imgVerInfo.getImgId() + "】!");
+            log.info("用户图片验证信息不存在【imgId=" + imgVerInfo.getImgId() + "】");
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                    "用户图片验证信息不存在【imgId=" + imgVerInfo.getImgId() + "】!");
+                    "用户图片验证信息不存在【imgId=" + imgVerInfo.getImgId() + "】");
         }
         //判断是否是想要的对象
         if (!imgVerInfoRes.getImgId().equals(imgVerInfo.getImgId())) {
             log.info("图片验证码唯一标志不一致!图片验证码唯一标志:{}", imgVerInfo.getImgId());
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "图片验证码唯一标志不一致!");
+                    "图片验证码唯一标志不一致");
         }
         if (!(imgVerInfoRes.getCode()).equals(imgVerInfo.getCode().toUpperCase())) {
             log.info("输入图形验证码有误!验证码:{}", imgVerInfo.getCode());
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "输入图形验证码有误!");
+                    "输入图形验证码有误");
         }
         //判断是否过期
         if (!DateUtil.after(imgVerInfoRes.getExpireTime(), DateUtil.now())) {
             log.info("图片验证码已过期,请重新获取!过期时间:{}", imgVerInfoRes.getExpireTime());
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "图片验证码已过期,请重新获取!");
+                    "图片验证码已过期,请重新获取");
         }
         return true;
     }

+ 11 - 11
user-service/src/main/java/com/diagbot/service/impl/SmsVerServiceImpl.java

@@ -60,7 +60,7 @@ public class SmsVerServiceImpl implements SmsVerService {
     public String smsSend(String mobile, String smsTemplateCode) {
         if (StringUtil.isBlank(mobile)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "电话号码不能为空!");
+                    "电话号码不能为空");
         }
 
         //组装请求对象-具体描述见控制台-文档部分内容
@@ -103,15 +103,15 @@ public class SmsVerServiceImpl implements SmsVerService {
     public Boolean createSmsVerification(SwsVerInfo swsVerInfo) {
         if (null == swsVerInfo) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "用户短信验证信息不能为空!");
+                    "用户短信验证信息不能为空");
         }
         if (StringUtil.isBlank(swsVerInfo.getMobile())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "用户电话不能为空!");
+                    "用户电话不能为空");
         }
         if (StringUtil.isBlank(swsVerInfo.getCode())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "验证码不能为空!");
+                    "验证码不能为空");
         }
         swsVerInfo.setCreateTime(DateUtil.now());
         final Date expireDate = DateUtil.addMinutes(DateUtil.now(),  ConstantEnum.SMS_EXPIRED_INTERVAL.getKey());
@@ -146,15 +146,15 @@ public class SmsVerServiceImpl implements SmsVerService {
     public Boolean verifySmsVerification(SwsVerInfo swsVerInfo) {
         if (null == swsVerInfo) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "用户短信验证信息不能为空!");
+                    "用户短信验证信息不能为空");
         }
         if (StringUtil.isBlank(swsVerInfo.getMobile())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "用户电话不能为空!");
+                    "用户电话不能为空");
         }
         if (StringUtil.isBlank(swsVerInfo.getCode())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-                    "短信验证码不能为空!");
+                    "短信验证码不能为空");
         }
         //从redis中取出
         final byte[] redis_key = getUserSmsKey(swsVerInfo.getMobile());
@@ -171,24 +171,24 @@ public class SmsVerServiceImpl implements SmsVerService {
         if (swsVerInfoRes == null) {
             log.info("用户短信验证信息不存在!用户电话:{}", swsVerInfo.getMobile());
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                    "用户短信验证信息不存在!");
+                    "用户短信验证信息不存在");
         }
         //判断是否是想要的对象
         if (!swsVerInfoRes.getMobile().equals(swsVerInfo.getMobile())) {
             log.info("用户电话不一致! 用户电话:{}", swsVerInfo.getMobile());
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "用户电话不一致!");
+                    "用户电话不一致");
         }
         if (!swsVerInfoRes.getCode().equals(swsVerInfo.getCode())) {
             log.info("短信验证码输入有误!用户电话:{},验证码:{}", swsVerInfo.getMobile(), swsVerInfo.getCode());
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "短信验证码输入有误!");
+                    "短信验证码输入有误");
         }
         //判断是否过期
         if (!DateUtil.after(swsVerInfoRes.getExpireTime(), DateUtil.now())) {
             log.info("短息验证码已过期,请重新获取!用户电话:{},过期时间:{}", swsVerInfo.getMobile(), swsVerInfoRes.getExpireTime());
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "短息验证码已过期,请重新获取!");
+                    "短息验证码已过期,请重新获取");
         }
         return true;
     }