|  | @@ -29,6 +29,8 @@ import com.ozs.service.entity.MsgAlarm;
 | 
												
													
														
															|  |  import com.ozs.service.entity.vo.CameraTreeVo;
 |  |  import com.ozs.service.entity.vo.CameraTreeVo;
 | 
												
													
														
															|  |  import com.ozs.service.entity.vo.MsgAlarmVo;
 |  |  import com.ozs.service.entity.vo.MsgAlarmVo;
 | 
												
													
														
															|  |  import com.ozs.service.service.BaseUserService;
 |  |  import com.ozs.service.service.BaseUserService;
 | 
												
													
														
															|  | 
 |  | +import com.ozs.system.domain.SysUserRole;
 | 
												
													
														
															|  | 
 |  | +import com.ozs.system.mapper.SysUserRoleMapper;
 | 
												
													
														
															|  |  import com.ozs.system.service.DataScoreUtil;
 |  |  import com.ozs.system.service.DataScoreUtil;
 | 
												
													
														
															|  |  import com.ozs.system.service.ISysDictTypeService;
 |  |  import com.ozs.system.service.ISysDictTypeService;
 | 
												
													
														
															|  |  import io.swagger.annotations.ApiOperation;
 |  |  import io.swagger.annotations.ApiOperation;
 | 
												
											
												
													
														
															|  | @@ -92,6 +94,8 @@ public class SysUserController extends BaseController {
 | 
												
													
														
															|  |      private ISysDictTypeService dictTypeService;
 |  |      private ISysDictTypeService dictTypeService;
 | 
												
													
														
															|  |      @Value("${base.defaultPassword:yn5aq5Mt.106.tky}")
 |  |      @Value("${base.defaultPassword:yn5aq5Mt.106.tky}")
 | 
												
													
														
															|  |      private String defaultPassword;
 |  |      private String defaultPassword;
 | 
												
													
														
															|  | 
 |  | +    @Autowired
 | 
												
													
														
															|  | 
 |  | +    private SysUserRoleMapper sysUserRoleMapper;
 | 
												
													
														
															|  |  //    /**
 |  |  //    /**
 | 
												
													
														
															|  |  //     * 获取用户列表
 |  |  //     * 获取用户列表
 | 
												
													
														
															|  |  //     */
 |  |  //     */
 | 
												
											
												
													
														
															|  | @@ -357,6 +361,20 @@ public class SysUserController extends BaseController {
 | 
												
													
														
															|  |      @Log(title = "用户管理", businessType = BusinessType.UPDATE)
 |  |      @Log(title = "用户管理", businessType = BusinessType.UPDATE)
 | 
												
													
														
															|  |      @GetMapping("/resetPwd/{id}")
 |  |      @GetMapping("/resetPwd/{id}")
 | 
												
													
														
															|  |      public AjaxResult resetPwd(@PathVariable(value = "id") Long id) {
 |  |      public AjaxResult resetPwd(@PathVariable(value = "id") Long id) {
 | 
												
													
														
															|  | 
 |  | +        boolean stop=false;
 | 
												
													
														
															|  | 
 |  | +        LambdaQueryWrapper<SysUserRole> wrapper=new LambdaQueryWrapper<>();
 | 
												
													
														
															|  | 
 |  | +        wrapper.eq(SysUserRole::getUserId,id);
 | 
												
													
														
															|  | 
 |  | +        List<SysUserRole> sysUserRoles = sysUserRoleMapper.selectList(wrapper);
 | 
												
													
														
															|  | 
 |  | +        for (SysUserRole sysUserRole : sysUserRoles) {
 | 
												
													
														
															|  | 
 |  | +            String roleKey = roleService.getRoleKey(sysUserRole.getRoleId());
 | 
												
													
														
															|  | 
 |  | +            if ("admin".equals(roleKey)){
 | 
												
													
														
															|  | 
 |  | +                stop=true;
 | 
												
													
														
															|  | 
 |  | +                break;
 | 
												
													
														
															|  | 
 |  | +            }
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  | 
 |  | +        if (!stop){
 | 
												
													
														
															|  | 
 |  | +            return error("只有超级管理员才能重置密码!!");
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  |          String password = null;
 |  |          String password = null;
 | 
												
													
														
															|  |          SysUser user = new SysUser();
 |  |          SysUser user = new SysUser();
 | 
												
													
														
															|  |          user.setId(id);
 |  |          user.setId(id);
 |