fix: 修改注销账号的实现方式
This commit is contained in:
parent
6deed61311
commit
49fd03df7f
@ -272,12 +272,9 @@ public class MemberBuyerController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "注销账号")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query")
|
||||
})
|
||||
@PutMapping("/cancellation")
|
||||
public ResultMessage<Member> cancellation(@NotNull(message = "密码不能为空") @RequestParam String password) {
|
||||
memberService.cancellation(password);
|
||||
public ResultMessage<Member> cancellation() {
|
||||
memberService.cancellation();
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
@ -135,10 +135,9 @@ public interface MemberService extends IService<Member> {
|
||||
/**
|
||||
* 注销账号
|
||||
*
|
||||
* @param password 密码
|
||||
* @return 操作结果
|
||||
*/
|
||||
void cancellation(String password);
|
||||
void cancellation();
|
||||
/**
|
||||
* 修改当前会员的手机号
|
||||
*
|
||||
|
@ -375,19 +375,17 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancellation(String password) {
|
||||
public void cancellation() {
|
||||
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
if (tokenUser == null) {
|
||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
Member member = this.getById(tokenUser.getId());
|
||||
if (member.getPassword().equals(new BCryptPasswordEncoder().encode(password))) {
|
||||
//删除联合登录
|
||||
connectService.deleteByMemberId(member.getId());
|
||||
//混淆用户信息
|
||||
this.confusionMember(member);
|
||||
}
|
||||
//删除联合登录
|
||||
connectService.deleteByMemberId(member.getId());
|
||||
//混淆用户信息
|
||||
this.confusionMember(member);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user