From e9111f916530ea7b42fc73f61d61b8840f14ce9a Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Thu, 22 Oct 2020 18:46:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81,?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=89=AB=E7=A0=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SystemLogController.java | 4 +- .../controller/UserLoginController.java | 13 ++- .../hrauth/service/UserLoginService.java | 2 + .../service/impl/UserLoginServiceImpl.java | 5 ++ .../hrauth/service/impl/UserServiceImpl.java | 2 +- .../src/main/resources/bootstrap.properties | 84 +++++++++---------- .../hrms/controller/EmployeeController.java | 5 +- .../hrms/request/BindOpenIdRequest.java | 3 +- .../domain/hrms/request/ResetPwdRequest.java | 2 +- .../domain/hrms/request/UpdatePwdRequest.java | 2 +- .../domain/hrms/request/UserLoginRequest.java | 2 +- .../src/main/resources/jwt.properties | 3 +- 12 files changed, 72 insertions(+), 55 deletions(-) diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/SystemLogController.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/SystemLogController.java index 04d1a558..78d455c8 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/SystemLogController.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/SystemLogController.java @@ -30,7 +30,7 @@ public class SystemLogController implements SystemLogControllerApi { private LoginLogService loginLogService; @GetMapping("/list") - @Log(detail = "系统日志列表",level = 3,operationUnit = OperationUnit.ROLE,operationType = OperationType.SELECT) + //@Log(detail = "系统日志列表",level = 3,operationUnit = OperationUnit.ROLE,operationType = OperationType.SELECT) public ResponseResult list(@RequestParam("page") Integer page, @RequestParam("size") Integer size) { PageUtils data = systemLogService.queryPage(page, size); @@ -38,7 +38,7 @@ public class SystemLogController implements SystemLogControllerApi { } @GetMapping("/loginLogList") - @Log(detail = "登录日志列表",level = 3,operationUnit = OperationUnit.ROLE,operationType = OperationType.SELECT) + //@Log(detail = "登录日志列表",level = 3,operationUnit = OperationUnit.ROLE,operationType = OperationType.SELECT) public ResponseResult loginLogList(@RequestParam("page") Integer page, @RequestParam("size") Integer size, UserLoginLogRequest userLoginLogRequest) { PageUtils data = loginLogService.queryPage(page, size,userLoginLogRequest); diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java index 2bcf4ec5..e52737d8 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java @@ -132,7 +132,7 @@ public class UserLoginController implements UserLoginControllerApi { } } - /** + /** * 绑定手机号和openId * @param bindOpenIdRequest * @return @@ -154,4 +154,15 @@ public class UserLoginController implements UserLoginControllerApi { return result ? ResponseResult.SUCCESS("短信发送成功") : ResponseResult.FAIL(55001,"短信发送失败"); } + /** + * 判断手机号是否存在 + * @param mobile + * @return + */ + @GetMapping("/isPhoneExist") + public ResponseResult isPhoneExist(@RequestParam("mobile") String mobile){ + int result = userLoginService.isPhoneExist(mobile); + return result>0 ? ResponseResult.SUCCESS() : ResponseResult.FAIL(55002,"该手机号不存在"); + } + } diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/UserLoginService.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/UserLoginService.java index 1669fca7..025d2a0c 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/UserLoginService.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/UserLoginService.java @@ -19,4 +19,6 @@ public interface UserLoginService extends IService { Boolean updatePwd(UpdatePwdRequest user); boolean bindPhoneAndOpenId(BindOpenIdRequest bindOpenIdRequest); + + int isPhoneExist(String mobile); } diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java index 29c98f3d..4dccd1d5 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java @@ -229,5 +229,10 @@ public class UserLoginServiceImpl extends ServiceImpl return count>0; } + @Override + public int isPhoneExist(String mobile) { + return userLoginDao.selectCount(mobile); + } + } diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java index 9170822b..1afdf45c 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java @@ -77,7 +77,7 @@ public class UserServiceImpl extends ServiceImpl imple if(dbUser == null){//openId不存在,返回绑定手机号页面,须另写绑定手机号接口 log.info("dbUser为空,openId不存在,请先绑定手机号哦~~~"); try { - response.sendRedirect("https://www.baidu.com?openId="+openId);//跳转绑定手机号页面 + response.sendRedirect("http://www.huorantech.cn/dq/index.html#/bind-phone?matched="+openId);//跳转绑定手机号页面 } catch (IOException e) { e.printStackTrace(); } diff --git a/dq-financial-hrms-auth/src/main/resources/bootstrap.properties b/dq-financial-hrms-auth/src/main/resources/bootstrap.properties index 6c1631cd..1ab68e8e 100644 --- a/dq-financial-hrms-auth/src/main/resources/bootstrap.properties +++ b/dq-financial-hrms-auth/src/main/resources/bootstrap.properties @@ -1,63 +1,63 @@ # 开发和测试环境(dev) -spring.application.name=dq-financial-hrms-auth - -spring.cloud.nacos.config.server-addr=192.168.31.142:8848 -spring.cloud.nacos.config.namespace=7632bdaa-3381-4669-b3f9-2fc73be451e8 -#spring.cloud.nacos.config.group=prod - -spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml -spring.cloud.nacos.config.ext-config[0].group=dev -spring.cloud.nacos.config.ext-config[0].refresh=true - -spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml -spring.cloud.nacos.config.ext-config[1].group=dev -spring.cloud.nacos.config.ext-config[1].refresh=true - -spring.cloud.nacos.config.ext-config[2].data-id=other.yml -spring.cloud.nacos.config.ext-config[2].group=dev -spring.cloud.nacos.config.ext-config[2].refresh=true - -spring.redis.host=127.0.0.1 -spring.redis.port=6379 -spring.redis.password=123456 -spring.redis.database=0 -spring.redis.timeout=30000 -spring.redis.jedis.pool.max-active=8 -spring.redis.jedis.pool.max-wait=-1 -spring.redis.jedis.pool.max-idle=8 -spring.redis.jedis.pool.min-idle=0 - -##微信开放平台配置 -#wxopen.appid=wx3b7bca679da34921 -#wxopen.appsecret=c8de113c18052b4e2173d913511e486d -##回调地址 -#wxopen.redirect_url=http://www.occupationlab.com/apiHrmsAuth/hrms/auth/userlogin/user/callback -# -##正式环境(prod) #spring.application.name=dq-financial-hrms-auth # -#spring.cloud.nacos.config.server-addr=120.78.127.12:8848 -#spring.cloud.nacos.config.namespace=b590c830-7ada-44b7-968f-e8d0c81990c4 +#spring.cloud.nacos.config.server-addr=192.168.31.142:8848 +#spring.cloud.nacos.config.namespace=7632bdaa-3381-4669-b3f9-2fc73be451e8 ##spring.cloud.nacos.config.group=prod # #spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml -#spring.cloud.nacos.config.ext-config[0].group=prod +#spring.cloud.nacos.config.ext-config[0].group=dev #spring.cloud.nacos.config.ext-config[0].refresh=true # #spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml -#spring.cloud.nacos.config.ext-config[1].group=prod +#spring.cloud.nacos.config.ext-config[1].group=dev #spring.cloud.nacos.config.ext-config[1].refresh=true # #spring.cloud.nacos.config.ext-config[2].data-id=other.yml -#spring.cloud.nacos.config.ext-config[2].group=prod +#spring.cloud.nacos.config.ext-config[2].group=dev #spring.cloud.nacos.config.ext-config[2].refresh=true # #spring.redis.host=127.0.0.1 #spring.redis.port=6379 -#spring.redis.password=dq123456 +#spring.redis.password=123456 #spring.redis.database=0 #spring.redis.timeout=30000 #spring.redis.jedis.pool.max-active=8 #spring.redis.jedis.pool.max-wait=-1 #spring.redis.jedis.pool.max-idle=8 -#spring.redis.jedis.pool.min-idle=0 \ No newline at end of file +#spring.redis.jedis.pool.min-idle=0 + +##微信开放平台配置 +#wxopen.appid=wx3b7bca679da34921 +#wxopen.appsecret=c8de113c18052b4e2173d913511e486d +##回调地址 +#wxopen.redirect_url=http://www.occupationlab.com/apiHrmsAuth/hrms/auth/userlogin/user/callback +# +##正式环境(prod) +spring.application.name=dq-financial-hrms-auth + +spring.cloud.nacos.config.server-addr=120.78.127.12:8848 +spring.cloud.nacos.config.namespace=b590c830-7ada-44b7-968f-e8d0c81990c4 +#spring.cloud.nacos.config.group=prod + +spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml +spring.cloud.nacos.config.ext-config[0].group=prod +spring.cloud.nacos.config.ext-config[0].refresh=true + +spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml +spring.cloud.nacos.config.ext-config[1].group=prod +spring.cloud.nacos.config.ext-config[1].refresh=true + +spring.cloud.nacos.config.ext-config[2].data-id=other.yml +spring.cloud.nacos.config.ext-config[2].group=prod +spring.cloud.nacos.config.ext-config[2].refresh=true + +spring.redis.host=127.0.0.1 +spring.redis.port=6379 +spring.redis.password=dq123456 +spring.redis.database=0 +spring.redis.timeout=30000 +spring.redis.jedis.pool.max-active=8 +spring.redis.jedis.pool.max-wait=-1 +spring.redis.jedis.pool.max-idle=8 +spring.redis.jedis.pool.min-idle=0 \ No newline at end of file diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java index 10679a82..5fb2ec81 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java @@ -1,8 +1,5 @@ package com.daqing.financial.hrms.controller; -import com.daqing.financial.hrauth.annotation.Log; -import com.daqing.financial.hrauth.enums.OperationType; -import com.daqing.financial.hrauth.enums.OperationUnit; import com.daqing.financial.hrms.EmployeeControllerApi; import com.daqing.financial.hrms.service.EmployeeService; import com.daqing.framework.domain.crms.request.EmployeeDisableRequest; @@ -42,7 +39,7 @@ public class EmployeeController implements EmployeeControllerApi { private EmployeeService employeeService; @GetMapping("/list") - @Log(detail = "员工列表",level = 3,operationUnit = OperationUnit.ROLE,operationType = OperationType.INSERT) + //@Log(detail = "员工列表",level = 3,operationUnit = OperationUnit.ROLE,operationType = OperationType.INSERT) //@RequiresPermissions("hrms:employee:info") public ResponseResult list(@RequestParam("page") Integer page, @RequestParam("size") Integer size, diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/BindOpenIdRequest.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/BindOpenIdRequest.java index 492fce66..7d6e5cc9 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/BindOpenIdRequest.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/BindOpenIdRequest.java @@ -19,7 +19,8 @@ public class BindOpenIdRequest implements Serializable { * 手机账号 */ @NotBlank(message = "手机账号不能为空!") - @Pattern(regexp = "^1(3([0-35-9]\\d|4[1-8])|4[14-9]\\d|5([0125689]\\d|7[1-79])|66\\d|7[2-35-8]\\d|8\\d{2}|9[13589]\\d)\\d{7}$",message = "手机号格式不正确!") + //@Pattern(regexp = "^[1][3,4,5,7,8][0-9]{9}$",message = "手机号格式不正确!") + @Pattern(regexp = "^1(3\\d|4[5-8]|5[0-35-9]|6[567]|7[01345-8]|8\\d|9[025-9])\\d{8}$",message = "手机号格式不正确!") private String phoneAccount; /** diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/ResetPwdRequest.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/ResetPwdRequest.java index 96accb61..5e2df384 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/ResetPwdRequest.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/ResetPwdRequest.java @@ -29,6 +29,6 @@ public class ResetPwdRequest implements Serializable { /** * 手机账号 */ - @Pattern(regexp = "^1(3([0-35-9]\\d|4[1-8])|4[14-9]\\d|5([0125689]\\d|7[1-79])|66\\d|7[2-35-8]\\d|8\\d{2}|9[13589]\\d)\\d{7}$",message = "手机号格式不正确!") + @Pattern(regexp = "^^1(3\\d|4[5-8]|5[0-35-9]|6[567]|7[01345-8]|8\\d|9[025-9])\\d{8}$",message = "手机号格式不正确!") private String phoneAccount; } diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UpdatePwdRequest.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UpdatePwdRequest.java index d131986c..7edf7463 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UpdatePwdRequest.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UpdatePwdRequest.java @@ -19,7 +19,7 @@ public class UpdatePwdRequest implements Serializable { /** * 手机账号 */ - @Pattern(regexp = "^1(3([0-35-9]\\d|4[1-8])|4[14-9]\\d|5([0125689]\\d|7[1-79])|66\\d|7[2-35-8]\\d|8\\d{2}|9[13589]\\d)\\d{7}$",message = "手机号格式不正确!") + @Pattern(regexp = "^1(3\\d|4[5-8]|5[0-35-9]|6[567]|7[01345-8]|8\\d|9[025-9])\\d{8}$",message = "手机号格式不正确!") private String phoneAccount; /** diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginRequest.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginRequest.java index ff5434a0..9729e69b 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginRequest.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginRequest.java @@ -20,7 +20,7 @@ public class UserLoginRequest implements Serializable { * 手机账号 */ @NotBlank(message = "手机号码不能为空!") - @Pattern(regexp = "^1(3([0-35-9]\\d|4[1-8])|4[14-9]\\d|5([0125689]\\d|7[1-79])|66\\d|7[2-35-8]\\d|8\\d{2}|9[13589]\\d)\\d{7}$",message = "手机号格式不正确!") + @Pattern(regexp = "^1(3\\d|4[5-8]|5[0-35-9]|6[567]|7[01345-8]|8\\d|9[025-9])\\d{8}$",message = "手机号格式不正确!") private String phoneAccount; /** diff --git a/dq-govern-gateway/src/main/resources/jwt.properties b/dq-govern-gateway/src/main/resources/jwt.properties index 3b9dcc4d..d54a9c3a 100644 --- a/dq-govern-gateway/src/main/resources/jwt.properties +++ b/dq-govern-gateway/src/main/resources/jwt.properties @@ -9,4 +9,5 @@ jwt.ignoreUrlList=/apiHrmsAuth/hrms/auth/userlogin/getBackPwd,\ /api-crms/crms/customer/excelExport,\ /api-crms/crms/customer/excelImport,\ /apiHrmsAuth/hrms/auth/userlogin/bindPhoneAndOpenId,\ - /apiHrmsAuth/hrms/auth/userlogin/sendCode + /apiHrmsAuth/hrms/auth/userlogin/sendCode,\ + /apiHrmsAuth/hrms/auth/userlogin/isPhoneExist