重置密码

hehai
shijie 4 years ago
parent e3f48ad9b5
commit 11bce15e75
  1. 20
      src/main/java/com/msdw/tms/controller/SysRoleController.java
  2. 20
      src/main/java/com/msdw/tms/controller/SysRolePermissionController.java
  3. 20
      src/main/java/com/msdw/tms/controller/SysUserRoleController.java
  4. 11
      src/main/java/com/msdw/tms/controller/SystemSettingController.java
  5. 2
      src/main/java/com/msdw/tms/service/SystemSetttingService.java
  6. 15
      src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java

@ -1,20 +0,0 @@
package com.msdw.tms.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 用户角色表 前端控制器
* </p>
*
* @author Qyq
* @since 2021-02-24
*/
@RestController
@RequestMapping("/sys-role")
public class SysRoleController {
}

@ -1,20 +0,0 @@
package com.msdw.tms.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 角色权限中间表 前端控制器
* </p>
*
* @author Qyq
* @since 2021-02-24
*/
@RestController
@RequestMapping("/sys-role-permission")
public class SysRolePermissionController {
}

@ -1,20 +0,0 @@
package com.msdw.tms.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 用户角色中间表 前端控制器
* </p>
*
* @author Qyq
* @since 2021-02-24
*/
@RestController
@RequestMapping("/sys-user-role")
public class SysUserRoleController {
}

@ -154,4 +154,15 @@ public class SystemSettingController implements SystemSetttingApi {
R result = systemSetttingService.queryAccount(account,schoolId);
return result;
}
/**
* 重置密码
* @param userId
* @return
*/
@GetMapping("/resetPwd")
public R resetPwd(@RequestParam Integer userId,String newPwd){
R r = systemSetttingService.resetPwd(userId,newPwd);
return r;
}
}

@ -34,4 +34,6 @@ public interface SystemSetttingService {
void downloadFiles(HttpServletResponse response) throws IOException;
R queryAccount(String account,Integer schoolId);
R resetPwd(Integer userId,String newPwd);
}

@ -2,6 +2,7 @@ package com.msdw.tms.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -497,4 +498,18 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
}
return R.ok();
}
@Override
@Transactional
public R resetPwd(Integer userId,String newPwd) {
UserInfoEntity user = new UserInfoEntity();
user.setPassword(newPwd);
int count = userInfoDao.update(user, new QueryWrapper<UserInfoEntity>().eq("userId", userId));
if(count > 0){
return R.ok();
}else{
return R.error(20002,"重置失败");
}
}
}
Loading…
Cancel
Save