|
|
@@ -117,13 +117,13 @@ public class PersonInfoApiController {
|
|
|
MessageResult<String> messageResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
|
- PersonInfo personInfo = personInfoService.findByPhone(phone);
|
|
|
+ /* PersonInfo personInfo = personInfoService.findByPhone(phone);
|
|
|
|
|
|
if (personInfo == null) {
|
|
|
throw new Exception("用户不存在!");
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
- String key = "SMS_" + personInfo.getId();
|
|
|
+ String key = "SMS_" + phone;
|
|
|
|
|
|
String verifyCode = (String) valueOperations.get(key);
|
|
|
|
|
|
@@ -133,13 +133,13 @@ public class PersonInfoApiController {
|
|
|
verifyCodeJSON.put("code", verifyCode);
|
|
|
|
|
|
// messageResult = SMSUtil.send(merchantInfo.getContactPhone(), "SMS_49390047", verifyCodeJSON.toString());
|
|
|
- messageResult = SMSUtil.send(personInfo.getPhone(), "校信达", "SMS_49390047", verifyCodeJSON);
|
|
|
+ messageResult = SMSUtil.send(phone, "校信达", "SMS_49390047", verifyCodeJSON);
|
|
|
|
|
|
//设置当前用户的验证码,5分钟内有效
|
|
|
valueOperations.set(key, verifyCode, 5, TimeUnit.MINUTES);
|
|
|
}
|
|
|
|
|
|
- messageResult.setData(personInfo.getId());
|
|
|
+ // messageResult.setData(personInfo.getId());
|
|
|
messageResult.setResult(true);
|
|
|
messageResult.setCode(200);
|
|
|
} catch (Exception ex) {
|
|
|
@@ -282,7 +282,13 @@ public class PersonInfoApiController {
|
|
|
if (personInfo.getPhone().equals(phone)){
|
|
|
throw new Exception("请修改手机号");
|
|
|
}
|
|
|
- String smsKey = "SMS_" + personInfo.getId();
|
|
|
+
|
|
|
+ PersonInfo personInfo1 = personInfoService.findByPhone(phone);
|
|
|
+ if (personInfo1 != null){
|
|
|
+ throw new Exception("手机号已被人注册");
|
|
|
+ }
|
|
|
+
|
|
|
+ String smsKey = "SMS_" + phone;
|
|
|
|
|
|
String beforeVerifyCode = (String) valueOperations.get(smsKey);
|
|
|
|
|
|
@@ -611,7 +617,7 @@ public class PersonInfoApiController {
|
|
|
|
|
|
@PostMapping("getWeather")
|
|
|
@ApiOperation(value = "获取当前城市的天气(公共接口)")
|
|
|
- public MessageResult<WeatherDTO> getCity(String cityName) {
|
|
|
+ public MessageResult<WeatherDTO> getWeather(String cityName) {
|
|
|
|
|
|
MessageResult<WeatherDTO> messageResult = new MessageResult<>();
|
|
|
|