|
@ -69,6 +69,8 @@ public class LoginController extends BaseController {
|
|
|
private RoleService roleService;
|
|
|
@Autowired
|
|
|
private LoginLogService loginLogService;
|
|
|
@Autowired
|
|
|
private RSAUtils rsaUtils;
|
|
|
|
|
|
/**
|
|
|
* 公钥生成并返回接口
|
|
@ -79,8 +81,9 @@ public class LoginController extends BaseController {
|
|
|
@ResponseBody
|
|
|
public String publicKey() {
|
|
|
try {
|
|
|
String modulus = RSAUtils.getInstance(smsService).getModulus();
|
|
|
String exponent = RSAUtils.getInstance(smsService).getExponent();
|
|
|
rsaUtils.setBaseService(smsService);
|
|
|
String modulus = rsaUtils.getModulus();
|
|
|
String exponent = rsaUtils.getExponent();
|
|
|
if (StringUtils.isEmpty(modulus) || StringUtils.isEmpty(exponent)) {
|
|
|
return error(-1, "公钥获取失败!");
|
|
|
} else {
|
|
@ -130,7 +133,8 @@ public class LoginController extends BaseController {
|
|
|
}
|
|
|
//身份证登录
|
|
|
if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(password)) {
|
|
|
password = RSAUtils.getInstance(doctorService).decryptString(password);
|
|
|
rsaUtils.setBaseService(doctorService);
|
|
|
password = rsaUtils.decryptString(password);
|
|
|
password = StringUtils.reverse(password);
|
|
|
Doctor doctor = doctorService.findDoctorByMobile(mobile);
|
|
|
loginLog.setLoginType("2");
|