Compare commits

..

No commits in common. "38b7a8f3ad975dc70fd65b726f52dbc886438862" and "39b7a362c2fdfa9a80917b697a905c2a9982684c" have entirely different histories.

6 changed files with 3 additions and 41 deletions

View File

@ -66,16 +66,4 @@ public class PlayletUserAppController {
}
}
@ResponseBody
@PostMapping(value = "/updatePasswordByCode")
@ApiOperation(value = "验证码修改密码", httpMethod = "POST")
public Result<String> updatePasswordByCode(@RequestBody PlayUserReq playUserReq){
try {
playletUserAppService.updatePasswordByCode(playUserReq);
return Result.success();
}catch (Exception e){
return Result.error(e.getMessage());
}
}
}

View File

@ -32,9 +32,4 @@ public interface PlayletUserAppService {
*/
void updatePlayletUser(PlayletUser playletUser);
/**
* @param playUserReq 用户资料
*/
void updatePasswordByCode(PlayUserReq playUserReq) throws Exception;
}

View File

@ -67,24 +67,4 @@ public class PlayletUserAppServiceImpl implements PlayletUserAppService {
public void updatePlayletUser(PlayletUser playletUser) {
iPlayletUserService.updateById(playletUser);
}
@Override
public void updatePasswordByCode(PlayUserReq playUserReq) throws Exception{
String alreadyCode = stringRedisTemplate.opsForValue().get(RedisConstants.SMS_CODE_PREFIX + playUserReq.getPhone());
if(StringUtils.isEmpty(alreadyCode)){
throw new Exception("验证码已过期!");
}
if(!alreadyCode.equals(playUserReq.getCode())){
throw new Exception("短信验证码错误!");
}
PlayletUser user = iPlayletUserService.lambdaQuery()
.eq(PlayletUser::getPhone, playUserReq.getPhone()).one();
if(user == null){
throw new Exception("用户尚未注册!");
}else {
user.setPassword(playUserReq.getPassword());
iPlayletUserService.updateById(user);
}
}
}

View File

@ -32,7 +32,7 @@ public class WxServiceImpl implements WxService {
@Override
public String getOpenidByCode(String code) {
String url = "https://api.weixin.qq.com/sns/jscode2session?appid="+ wxConfig.getAppId() + "&secret=" + wxConfig.getSecret() + "&js_code=" + code + "&grant_type=authorization_code";
String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid="+ wxConfig.getAppId() + "&secret=" + wxConfig.getSecret() + "&code=" + code + "&grant_type=authorization_code";
log.info("调用微信获取openId,入参url:{}", url);
String result = HttpUtils.sendGet(url);
log.info("调用微信获取openId,响应内容:{}", result);

View File

@ -161,8 +161,8 @@ swagger:
#小程序配置
wx:
appId: 'wx0e233b84fa447fb4'
secret: '9d8a99595d25cfc852f3644dafd06e98'
appId: 'wx60fa92c432e05ed1'
secret: '8ff8ab065446e2ad552e88a37780d8fe'
#阿里云OSS配置
aliyun:

View File

@ -46,7 +46,6 @@ public class BaseEntity implements Serializable
/** 请求参数 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableField(exist = false)
private Map<String, Object> params;
public Map<String, Object> getParams()