forked from dyf/fys-Multi-tenant
个人中心修改密码2
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.fuyuanshen.app.controller;
|
||||
|
||||
import com.fuyuanshen.app.model.AppRegisterBody;
|
||||
import com.fuyuanshen.app.model.AppUpdatePasswordBody;
|
||||
import com.fuyuanshen.app.service.AppLoginService;
|
||||
import com.fuyuanshen.app.service.AppRegisterService;
|
||||
import com.fuyuanshen.common.core.domain.R;
|
||||
@ -38,7 +39,7 @@ public class AppUserCenterController {
|
||||
* 修改密码
|
||||
*/
|
||||
@PostMapping("/updatePassword")
|
||||
public R<Void> updatePassword(@Validated @RequestBody AppRegisterBody body) {
|
||||
public R<Void> updatePassword(@Validated @RequestBody AppUpdatePasswordBody body) {
|
||||
registerService.updatePassword(body);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
package com.fuyuanshen.app.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppUpdatePasswordBody {
|
||||
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
private String password;
|
||||
}
|
||||
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.fuyuanshen.app.domain.AppUser;
|
||||
import com.fuyuanshen.app.mapper.AppUserMapper;
|
||||
import com.fuyuanshen.app.model.AppRegisterBody;
|
||||
import com.fuyuanshen.app.model.AppUpdatePasswordBody;
|
||||
import com.fuyuanshen.common.core.constant.Constants;
|
||||
import com.fuyuanshen.common.core.constant.GlobalConstants;
|
||||
import com.fuyuanshen.common.core.domain.model.RegisterBody;
|
||||
@ -144,7 +145,7 @@ public class AppRegisterService {
|
||||
userMapper.update(updateWrapper);
|
||||
}
|
||||
|
||||
public void updatePassword(AppRegisterBody body) {
|
||||
public void updatePassword(AppUpdatePasswordBody body) {
|
||||
String username = AppLoginHelper.getUsername();
|
||||
String password = body.getPassword();
|
||||
UpdateWrapper<AppUser> updateWrapper = new UpdateWrapper<>();
|
||||
|
||||
Reference in New Issue
Block a user