mirror of https://gitee.com/stylefeng/roses
【7.6.0】【sys】更新重置密码操作管理员才可以进行
parent
555762b726
commit
8e1c5c31cc
|
@ -21,7 +21,12 @@ public enum UserExceptionEnum implements AbstractExceptionEnum {
|
|||
/**
|
||||
* 请求状值为非正确状态值
|
||||
*/
|
||||
REQUEST_USER_STATUS_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10002", "请求状态值不合法,用户状态参数不合法,参数值:{}");
|
||||
REQUEST_USER_STATUS_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10002", "请求状态值不合法,用户状态参数不合法,参数值:{}"),
|
||||
|
||||
/**
|
||||
* 无法操作,只有超级管理员可以重置密码!
|
||||
*/
|
||||
RESET_PASSWORD_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10003", "无法操作,只有超级管理员可以重置密码!");
|
||||
|
||||
/**
|
||||
* 错误编码
|
||||
|
|
|
@ -17,6 +17,7 @@ import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
|||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
import cn.stylefeng.roses.kernel.sys.api.callback.RemoveUserCallbackApi;
|
||||
import cn.stylefeng.roses.kernel.sys.api.enums.user.UserStatusEnum;
|
||||
import cn.stylefeng.roses.kernel.sys.api.exception.enums.UserExceptionEnum;
|
||||
import cn.stylefeng.roses.kernel.sys.api.expander.SysConfigExpander;
|
||||
import cn.stylefeng.roses.kernel.sys.api.pojo.user.UserOrgDTO;
|
||||
import cn.stylefeng.roses.kernel.sys.modular.user.entity.SysUser;
|
||||
|
@ -193,6 +194,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
|
||||
@Override
|
||||
public void resetPassword(SysUserRequest sysUserRequest) {
|
||||
|
||||
// 只有超级管理员能重置密码
|
||||
if (!LoginContext.me().getSuperAdminFlag()) {
|
||||
throw new ServiceException(UserExceptionEnum.RESET_PASSWORD_ERROR);
|
||||
}
|
||||
|
||||
SysUser sysUser = this.querySysUser(sysUserRequest);
|
||||
|
||||
// 获取系统配置的默认密码
|
||||
|
|
Loading…
Reference in New Issue