短信验证码,微信扫码登录

master
shijie 4 years ago
parent ee26c4e201
commit e9111f9165
  1. 4
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/SystemLogController.java
  2. 11
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java
  3. 2
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/UserLoginService.java
  4. 5
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  5. 2
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserServiceImpl.java
  6. 82
      dq-financial-hrms-auth/src/main/resources/bootstrap.properties
  7. 5
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  8. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/BindOpenIdRequest.java
  9. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/ResetPwdRequest.java
  10. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UpdatePwdRequest.java
  11. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/UserLoginRequest.java
  12. 3
      dq-govern-gateway/src/main/resources/jwt.properties

@ -30,7 +30,7 @@ public class SystemLogController implements SystemLogControllerApi {
private LoginLogService loginLogService; private LoginLogService loginLogService;
@GetMapping("/list") @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, public ResponseResult list(@RequestParam("page") Integer page,
@RequestParam("size") Integer size) { @RequestParam("size") Integer size) {
PageUtils data = systemLogService.queryPage(page, size); PageUtils data = systemLogService.queryPage(page, size);
@ -38,7 +38,7 @@ public class SystemLogController implements SystemLogControllerApi {
} }
@GetMapping("/loginLogList") @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, public ResponseResult loginLogList(@RequestParam("page") Integer page,
@RequestParam("size") Integer size, UserLoginLogRequest userLoginLogRequest) { @RequestParam("size") Integer size, UserLoginLogRequest userLoginLogRequest) {
PageUtils data = loginLogService.queryPage(page, size,userLoginLogRequest); PageUtils data = loginLogService.queryPage(page, size,userLoginLogRequest);

@ -154,4 +154,15 @@ public class UserLoginController implements UserLoginControllerApi {
return result ? ResponseResult.SUCCESS("短信发送成功") : ResponseResult.FAIL(55001,"短信发送失败"); 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,"该手机号不存在");
}
} }

@ -19,4 +19,6 @@ public interface UserLoginService extends IService<UserEntity> {
Boolean updatePwd(UpdatePwdRequest user); Boolean updatePwd(UpdatePwdRequest user);
boolean bindPhoneAndOpenId(BindOpenIdRequest bindOpenIdRequest); boolean bindPhoneAndOpenId(BindOpenIdRequest bindOpenIdRequest);
int isPhoneExist(String mobile);
} }

@ -229,5 +229,10 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
return count>0; return count>0;
} }
@Override
public int isPhoneExist(String mobile) {
return userLoginDao.selectCount(mobile);
}
} }

@ -77,7 +77,7 @@ public class UserServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> imple
if(dbUser == null){//openId不存在,返回绑定手机号页面,须另写绑定手机号接口 if(dbUser == null){//openId不存在,返回绑定手机号页面,须另写绑定手机号接口
log.info("dbUser为空,openId不存在,请先绑定手机号哦~~~"); log.info("dbUser为空,openId不存在,请先绑定手机号哦~~~");
try { 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) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }

@ -1,63 +1,63 @@
# 开发和测试环境(dev) # 开发和测试环境(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.application.name=dq-financial-hrms-auth
# #
#spring.cloud.nacos.config.server-addr=120.78.127.12:8848 #spring.cloud.nacos.config.server-addr=192.168.31.142:8848
#spring.cloud.nacos.config.namespace=b590c830-7ada-44b7-968f-e8d0c81990c4 #spring.cloud.nacos.config.namespace=7632bdaa-3381-4669-b3f9-2fc73be451e8
##spring.cloud.nacos.config.group=prod ##spring.cloud.nacos.config.group=prod
# #
#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml #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[0].refresh=true
# #
#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml #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[1].refresh=true
# #
#spring.cloud.nacos.config.ext-config[2].data-id=other.yml #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.cloud.nacos.config.ext-config[2].refresh=true
# #
#spring.redis.host=127.0.0.1 #spring.redis.host=127.0.0.1
#spring.redis.port=6379 #spring.redis.port=6379
#spring.redis.password=dq123456 #spring.redis.password=123456
#spring.redis.database=0 #spring.redis.database=0
#spring.redis.timeout=30000 #spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8 #spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1 #spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8 #spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0 #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

@ -1,8 +1,5 @@
package com.daqing.financial.hrms.controller; 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.EmployeeControllerApi;
import com.daqing.financial.hrms.service.EmployeeService; import com.daqing.financial.hrms.service.EmployeeService;
import com.daqing.framework.domain.crms.request.EmployeeDisableRequest; import com.daqing.framework.domain.crms.request.EmployeeDisableRequest;
@ -42,7 +39,7 @@ public class EmployeeController implements EmployeeControllerApi {
private EmployeeService employeeService; private EmployeeService employeeService;
@GetMapping("/list") @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") //@RequiresPermissions("hrms:employee:info")
public ResponseResult list(@RequestParam("page") Integer page, public ResponseResult list(@RequestParam("page") Integer page,
@RequestParam("size") Integer size, @RequestParam("size") Integer size,

@ -19,7 +19,8 @@ public class BindOpenIdRequest implements Serializable {
* 手机账号 * 手机账号
*/ */
@NotBlank(message = "手机账号不能为空!") @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; private String phoneAccount;
/** /**

@ -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; private String phoneAccount;
} }

@ -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; private String phoneAccount;
/** /**

@ -20,7 +20,7 @@ public class UserLoginRequest implements Serializable {
* 手机账号 * 手机账号
*/ */
@NotBlank(message = "手机号码不能为空!") @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; private String phoneAccount;
/** /**

@ -9,4 +9,5 @@ jwt.ignoreUrlList=/apiHrmsAuth/hrms/auth/userlogin/getBackPwd,\
/api-crms/crms/customer/excelExport,\ /api-crms/crms/customer/excelExport,\
/api-crms/crms/customer/excelImport,\ /api-crms/crms/customer/excelImport,\
/apiHrmsAuth/hrms/auth/userlogin/bindPhoneAndOpenId,\ /apiHrmsAuth/hrms/auth/userlogin/bindPhoneAndOpenId,\
/apiHrmsAuth/hrms/auth/userlogin/sendCode /apiHrmsAuth/hrms/auth/userlogin/sendCode,\
/apiHrmsAuth/hrms/auth/userlogin/isPhoneExist

Loading…
Cancel
Save