| | |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiSupport; |
| | | import com.ruoyi.common.core.domain.param.ChangePwdParam; |
| | | import com.ruoyi.utils.result.Results; |
| | | import io.swagger.annotations.*; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public AjaxResult deptTree(SysDept dept) { |
| | | return success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å¯ç |
| | | */ |
| | | @ApiOperation("ä¿®æ¹å¯ç ") |
| | | @PreAuthorize("@ss.hasPermi('system:user:changePwd')") |
| | | @PutMapping("/changePwd") |
| | | public Results changePwd(@RequestBody ChangePwdParam changePwdParam) { |
| | | SysUser sysUser = userService.selectUserById(changePwdParam.getUserId()); |
| | | userService.checkUserAllowed(sysUser); |
| | | userService.checkUserDataScope(changePwdParam.getUserId()); |
| | | sysUser.setPassword(SecurityUtils.encryptPassword(changePwdParam.getNewPassword())); |
| | | sysUser.setUpdateBy(getUsername()); |
| | | int num = userService.resetPwd(sysUser); |
| | | if(num == 0){ |
| | | return Results.error("ä¿®æ¹å¯ç 失败ï¼"); |
| | | }else { |
| | | return Results.succeed("ä¿®æ¹å¯ç æåï¼"); |
| | | } |
| | | } |
| | | } |