|
|
|
@ -2133,15 +2133,16 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void bindAccountPhone(JSONObject device, JSONObject phone) {
|
|
|
|
|
public void bindAccountPhone(JSONObject device) {
|
|
|
|
|
String codeKey = device.getString("account_id");
|
|
|
|
|
String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).get();
|
|
|
|
|
if (StringUtils.isNotEmpty(codeKeyValueRedis)) {
|
|
|
|
|
throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 1 minutes.");
|
|
|
|
|
}
|
|
|
|
|
JSONObject client = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
String codeKeyValue = RandomStringUtils.random(6, false, true);
|
|
|
|
|
String nationCode = phone.getString("nation_code").contains("+")?phone.getString("nation_code").substring(1):phone.getString("nation_code");
|
|
|
|
|
String phoneNumber = phone.getString("contact_phone");
|
|
|
|
|
String nationCode = client.getString("nation_code").contains("+")?client.getString("nation_code").substring(1):client.getString("nation_code");
|
|
|
|
|
String phoneNumber = client.getString("contact_phone");
|
|
|
|
|
ArrayList<String> param = new ArrayList<>();
|
|
|
|
|
param.add("绑定手机号");
|
|
|
|
|
param.add(codeKeyValue);
|
|
|
|
|