Commit 37774e4f authored by suntao's avatar suntao

Merge branch 'features/mo'

* features/mo:
  如果将普通用户改成超级管理 bug
parents 96956a91 051ea822
...@@ -146,14 +146,14 @@ public class UserController { ...@@ -146,14 +146,14 @@ public class UserController {
* @return * @return
*/ */
// @Security(authorityId = "User.add") @Security(authorityId = "User.add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<Boolean> addUser(@RequestBody @Valid UserModelVo userModelVo) { public Result<Boolean> addUser(@RequestBody @Valid UserModelVo userModelVo) {
return userService.addUser(userModelVo); return userService.addUser(userModelVo);
} }
@PutMapping("/modify") @PutMapping("/modify")
// @Security(authorityId = "User.update") @Security(authorityId = "User.update")
public Result<Boolean> modifyUser(@RequestBody @Valid UserModelVo userModelVo) { public Result<Boolean> modifyUser(@RequestBody @Valid UserModelVo userModelVo) {
return userService.modifyUser(userModelVo); return userService.modifyUser(userModelVo);
} }
...@@ -165,7 +165,7 @@ public class UserController { ...@@ -165,7 +165,7 @@ public class UserController {
* @return * @return
*/ */
@GetMapping("/list/get") @GetMapping("/list/get")
//@Security(authorityId = "User.list") @Security(authorityId = "User.list")
public Result<Page<User>> UserList(@Valid QueryUserListModel queryUserListModel) { public Result<Page<User>> UserList(@Valid QueryUserListModel queryUserListModel) {
return userService.getUserList(queryUserListModel); return userService.getUserList(queryUserListModel);
} }
...@@ -193,7 +193,7 @@ public class UserController { ...@@ -193,7 +193,7 @@ public class UserController {
} }
@PutMapping("/update/password") @PutMapping("/update/password")
// @Security(authorityId = "User.update") @Security(authorityId = "User.update")
public Result<Boolean> modifyUser(@RequestBody @Valid UpdatePasswordParam param) { public Result<Boolean> modifyUser(@RequestBody @Valid UpdatePasswordParam param) {
return userService.updatePassword(param); return userService.updatePassword(param);
} }
......
...@@ -3,6 +3,7 @@ package cn.quantgroup.cashloanflowboss.api.user.service; ...@@ -3,6 +3,7 @@ package cn.quantgroup.cashloanflowboss.api.user.service;
import cn.quantgroup.cashloanflowboss.api.login.model.Principal; import cn.quantgroup.cashloanflowboss.api.login.model.Principal;
import cn.quantgroup.cashloanflowboss.api.role.entity.Role; import cn.quantgroup.cashloanflowboss.api.role.entity.Role;
import cn.quantgroup.cashloanflowboss.api.role.repository.RoleRepository; import cn.quantgroup.cashloanflowboss.api.role.repository.RoleRepository;
import cn.quantgroup.cashloanflowboss.api.user.dictionary.UserRank;
import cn.quantgroup.cashloanflowboss.api.user.dictionary.UserStatus; import cn.quantgroup.cashloanflowboss.api.user.dictionary.UserStatus;
import cn.quantgroup.cashloanflowboss.api.user.entity.User; import cn.quantgroup.cashloanflowboss.api.user.entity.User;
import cn.quantgroup.cashloanflowboss.api.user.model.*; import cn.quantgroup.cashloanflowboss.api.user.model.*;
...@@ -300,7 +301,10 @@ public class UserServiceImpl implements UserService { ...@@ -300,7 +301,10 @@ public class UserServiceImpl implements UserService {
} }
exist.setChannelName(configuration.getChannelName()); exist.setChannelName(configuration.getChannelName());
} }
if (roleId == 1L) {
// 将普通用户设置成超级管理,需要级联设置用户级别
exist.setRank(UserRank.SUPER_ADMINISTRATOR);
}
//exist.setPassword(MD5Tools.md5(userModelVo.getPassword())); //exist.setPassword(MD5Tools.md5(userModelVo.getPassword()));
exist.setRoles(Collections.singletonList(role)); exist.setRoles(Collections.singletonList(role));
exist.setUpdateTime(new Date()); exist.setUpdateTime(new Date());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment