|
@@ -93,15 +93,15 @@ public class WxAppletUserController {
|
|
|
@PostMapping("/getUserPhoneNumber")
|
|
@PostMapping("/getUserPhoneNumber")
|
|
|
@ApiOperation(value = "快速手机号验证",position = 6)
|
|
@ApiOperation(value = "快速手机号验证",position = 6)
|
|
|
public CommonResult<String> getUserPhoneNumber(@RequestBody@Validated BizWxAppletGetUserPhoneNumberDTO source) throws WxErrorException {
|
|
public CommonResult<String> getUserPhoneNumber(@RequestBody@Validated BizWxAppletGetUserPhoneNumberDTO source) throws WxErrorException {
|
|
|
- log.info("\n手机号快速验证:appid = [{}], accessToken = [{}]",
|
|
|
|
|
- source.getAppid(), source.getAccessToken());
|
|
|
|
|
- if (StringUtils.isAnyBlank(source.getAppid(), source.getAccessToken())) {
|
|
|
|
|
|
|
+ log.info("\n手机号快速验证:appid = [{}], code = [{}]",
|
|
|
|
|
+ source.getAppid(), source.getCode());
|
|
|
|
|
+ if (StringUtils.isAnyBlank(source.getAppid(), source.getCode())) {
|
|
|
throw new IllegalArgumentException("请求参数非法,请核实!");
|
|
throw new IllegalArgumentException("请求参数非法,请核实!");
|
|
|
}
|
|
}
|
|
|
if (!wxMaService.switchover(source.getAppid())) {
|
|
if (!wxMaService.switchover(source.getAppid())) {
|
|
|
throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", source.getAppid()));
|
|
throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", source.getAppid()));
|
|
|
}
|
|
}
|
|
|
- WxMaPhoneNumberInfo phoneNumber = wxMaService.getUserService().getPhoneNumber(source.getAccessToken());
|
|
|
|
|
|
|
+ WxMaPhoneNumberInfo phoneNumber = wxMaService.getUserService().getPhoneNumber(source.getCode());
|
|
|
//更新当前用户的手机号
|
|
//更新当前用户的手机号
|
|
|
wxUserService.updatePhoneById(LoginUserStrategy.tr.getCurrentUserId(),phoneNumber);
|
|
wxUserService.updatePhoneById(LoginUserStrategy.tr.getCurrentUserId(),phoneNumber);
|
|
|
return CommonResult.success(phoneNumber.getPhoneNumber());
|
|
return CommonResult.success(phoneNumber.getPhoneNumber());
|