提交 d196b207 编写于 作者: rushui.chen's avatar rushui.chen

20191024 通过手机号查询用户是否存在

上级 301c1569
流水线 #16272 已失败 于阶段
in 1 second
......@@ -109,7 +109,6 @@ public class Test {
authCode.setMobile("13024112092");
String authCodeStr = JSONObject.toJSONString(authCode);
System.out.println(authCodeStr);
String contentResult2 = AESUtil.aesEncrypt(authCodeStr, "YCPQPx4qpQjEjDea");
String keyResult2 = RSAUtil.encrypt("YCPQPx4qpQjEjDea",publicKey);
EncryptEntity encryptTest2 = new EncryptEntity();
......@@ -146,9 +145,20 @@ public class Test {
System.out.println(JSONObject.toJSONString(encryptTest4));
System.out.println("--------------------获取图片验证码接口-------------");
BaseRequest authCodeImage = new BaseRequest();
authCodeImage.setFlag(1);
authCodeImage.setMobile("13957290846");
authCodeImage.setCaptchaAnswer("94a8f");
authCodeImage.setCaptchaToken("2abb0a9063f2eb563db560f7ff34fba6");
String authCodeStr7 = JSONObject.toJSONString(authCodeImage);
System.out.println(authCodeStr7);
String contentResult7 = AESUtil.aesEncrypt(authCodeStr7, "YCPQPx4qpQjEjDea");
String keyResult7 = RSAUtil.encrypt("YCPQPx4qpQjEjDea",publicKey);
EncryptEntity encryptTest7 = new EncryptEntity();
encryptTest7.setContent(contentResult7);
encryptTest7.setKey(keyResult7);
System.out.println(JSONObject.toJSONString(encryptTest7));
}
......
......@@ -82,8 +82,8 @@ public class AutoCodeController extends AccountBaseController {
String authCode = CommonUtil.createValidateCode(); //随机生成验证码
String message = "您的验证码是" + authCode + ",在10分钟内有效。如非本人操作,请忽略本短信!";
//判断账号是否已经存在
Account account = accountService.getByMobilePhone(mobilePhone);
long senderId = account == null ? 0L : account.getId();
AccountInfoEntity accountByMobilePhone = accountService.getAccountByMobilePhone(mobilePhone);
long senderId = accountByMobilePhone == null ? 0L : accountByMobilePhone.getId();
//验证码保存到redis,失效时间10分钟
cacheClient.set(this.getAuthCodeKey(mobilePhone, flag), authCode, 600);
logger.info(this.getAuthCodeKey(mobilePhone, flag));
......
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.server.entity.Account;
import com.pica.cloud.account.account.server.entity.AccountInfoEntity;
import java.util.Map;
/**
......@@ -28,4 +30,6 @@ public interface AccountService {
void refreshCache(long id);
AccountInfoEntity getAccountByMobilePhone(String mobilePhone);
}
......@@ -57,6 +57,12 @@ public class AccountServiceImpl implements AccountService {
return accountMapper.getByMobilePhone(encryptMobilePhone);
}
@Override
public AccountInfoEntity getAccountByMobilePhone(String mobilePhone) {
String encryptMobilePhone = EncryptUtils.encryptContent(mobilePhone, EncryptConstants.ENCRYPT_TYPE_MOBILE);
return accountInfoDetailMapper.selectByMobile(encryptMobilePhone);
}
//根据微信unionid获取账号
public Account getByUnionid(String unionid) {
return accountMapper.getByUnionid(unionid);
......
spring.profiles.active=uat
spring.profiles.active=dev
\ No newline at end of file
......@@ -295,7 +295,7 @@
<select id="getByMobilePhone" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from account_info
from p_doctor
where mobile_phone = #{mobilePhone} and delete_flag = 1 limit 1
</select>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册