Upd:修改个人设置短信验证码发送接口

master
duLingLing 5 years ago
parent 671f143d28
commit e028ec8a6d

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.2.58</version> <version>1.2.59</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -189,7 +189,7 @@ public interface RetailAppService {
void updateAccountEmail(JSONObject device, JSONObject codekey); void updateAccountEmail(JSONObject device, JSONObject codekey);
void bindAccountPhone(JSONObject device, JSONObject phone); void bindAccountPhone(JSONObject device);
JSONObject updateAccountPhone(JSONObject device,JSONObject codekey); JSONObject updateAccountPhone(JSONObject device,JSONObject codekey);

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

@ -725,12 +725,11 @@ public class RetailAppController {
* *
* *
* @param device * @param device
* @param phone contact_phone
* @throws Exception * @throws Exception
*/ */
@PutMapping("/account/phone") @PutMapping("/account/phone")
public JSONObject bindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject phone) throws Exception { public JSONObject bindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device) throws Exception {
retailAppService.bindAccountPhone(device, phone); retailAppService.bindAccountPhone(device);
return new JSONObject(); return new JSONObject();
} }

Loading…
Cancel
Save