|
@@ -27,6 +27,7 @@ import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
import com.jeeplus.logging.annotation.ApiLog;
|
|
|
import com.jeeplus.sys.domain.Office;
|
|
|
import com.jeeplus.sys.domain.User;
|
|
|
+import com.jeeplus.sys.domain.vo.UserVO;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.service.OfficeService;
|
|
|
import com.jeeplus.sys.service.UserService;
|
|
@@ -679,6 +680,31 @@ public class UserController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 手机端-修改密码
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @DemoMode
|
|
|
+ @ApiLog("手机端-修改密码")
|
|
|
+ @PostMapping("/savePwdByPhone")
|
|
|
+ public ResponseEntity savePwdByPhone(@Valid @RequestBody UserVO userVO) {
|
|
|
+ UserDTO userDTO = userService.get(userVO.getUserId());
|
|
|
+ if ( StrUtil.isNotBlank ( userVO.getOldPassword() ) && StrUtil.isNotBlank ( userVO.getNewPassword() ) ) {
|
|
|
+ if ( SecurityUtils.validatePassword ( userVO.getOldPassword(), userDTO.getPassword ( ) ) ) {
|
|
|
+ User user = new User ( userDTO.getId ( ) );
|
|
|
+ user.setPassword ( SecurityUtils.encryptPassword ( userVO.getNewPassword() ) );
|
|
|
+ user.setUpPassword("1");
|
|
|
+ userService.updateById ( user );
|
|
|
+ UserUtils.deleteCache ( userDTO );
|
|
|
+ return ResponseEntity.ok ( "修改密码成功!" );
|
|
|
+ } else {
|
|
|
+ return ResponseEntity.badRequest ( ).body ( "修改密码失败,旧密码错误!" );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResponseEntity.badRequest ( ).body ( "参数错误!" );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取菜单
|
|
|
*
|
|
|
* @return
|