mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-11-17 14:43:42 +08:00
Merge branch '5.X' into future/flowable
This commit is contained in:
@@ -68,8 +68,8 @@ public class SysConfigController extends BaseController {
|
||||
* @param configKey 参数Key
|
||||
*/
|
||||
@GetMapping(value = "/configKey/{configKey}")
|
||||
public R<Void> getConfigKey(@PathVariable String configKey) {
|
||||
return R.ok(configService.selectConfigByKey(configKey));
|
||||
public R<String> getConfigKey(@PathVariable String configKey) {
|
||||
return R.ok("操作成功", configService.selectConfigByKey(configKey));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
import org.dromara.system.domain.bo.SysUserPasswordBo;
|
||||
import org.dromara.system.domain.bo.SysUserProfileBo;
|
||||
import org.dromara.system.domain.vo.AvatarVo;
|
||||
import org.dromara.system.domain.vo.ProfileVo;
|
||||
@@ -76,22 +77,21 @@ public class SysProfileController extends BaseController {
|
||||
/**
|
||||
* 重置密码
|
||||
*
|
||||
* @param newPassword 旧密码
|
||||
* @param oldPassword 新密码
|
||||
* @param bo 新旧密码
|
||||
*/
|
||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/updatePwd")
|
||||
public R<Void> updatePwd(String oldPassword, String newPassword) {
|
||||
public R<Void> updatePwd(@Validated @RequestBody SysUserPasswordBo bo) {
|
||||
SysUserVo user = userService.selectUserById(LoginHelper.getUserId());
|
||||
String password = user.getPassword();
|
||||
if (!BCrypt.checkpw(oldPassword, password)) {
|
||||
if (!BCrypt.checkpw(bo.getOldPassword(), password)) {
|
||||
return R.fail("修改密码失败,旧密码错误");
|
||||
}
|
||||
if (BCrypt.checkpw(newPassword, password)) {
|
||||
if (BCrypt.checkpw(bo.getNewPassword(), password)) {
|
||||
return R.fail("新密码不能与旧密码相同");
|
||||
}
|
||||
|
||||
if (userService.resetUserPwd(user.getUserId(), BCrypt.hashpw(newPassword)) > 0) {
|
||||
if (userService.resetUserPwd(user.getUserId(), BCrypt.hashpw(bo.getNewPassword())) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.fail("修改密码异常,请联系管理员");
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.dromara.system.domain.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户密码修改bo
|
||||
*/
|
||||
@Data
|
||||
public class SysUserPasswordBo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 旧密码
|
||||
*/
|
||||
@NotBlank(message = "旧密码不能为空")
|
||||
private String oldPassword;
|
||||
|
||||
/**
|
||||
* 新密码
|
||||
*/
|
||||
@NotBlank(message = "新密码不能为空")
|
||||
private String newPassword;
|
||||
}
|
||||
@@ -49,11 +49,8 @@ public class SysDataScopeServiceImpl implements ISysDataScopeService {
|
||||
.apply(DataBaseHelper.findInSet(deptId, "ancestors")));
|
||||
List<Long> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
|
||||
ids.add(deptId);
|
||||
List<SysDept> list = deptMapper.selectList(new LambdaQueryWrapper<SysDept>()
|
||||
.select(SysDept::getDeptId)
|
||||
.in(SysDept::getDeptId, ids));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
return StreamUtils.join(list, d -> Convert.toStr(d.getDeptId()));
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
return StreamUtils.join(ids, Convert::toStr);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
||||
public TableDataInfo<SysOperLogVo> selectPageOperLogList(SysOperLogBo operLog, PageQuery pageQuery) {
|
||||
Map<String, Object> params = operLog.getParams();
|
||||
LambdaQueryWrapper<SysOperLog> lqw = new LambdaQueryWrapper<SysOperLog>()
|
||||
.like(StringUtils.isNotBlank(operLog.getOperIp()), SysOperLog::getOperIp, operLog.getOperIp())
|
||||
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
||||
.eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
|
||||
SysOperLog::getBusinessType, operLog.getBusinessType())
|
||||
@@ -96,6 +97,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService {
|
||||
public List<SysOperLogVo> selectOperLogList(SysOperLogBo operLog) {
|
||||
Map<String, Object> params = operLog.getParams();
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<SysOperLog>()
|
||||
.like(StringUtils.isNotBlank(operLog.getOperIp()), SysOperLog::getOperIp, operLog.getOperIp())
|
||||
.like(StringUtils.isNotBlank(operLog.getTitle()), SysOperLog::getTitle, operLog.getTitle())
|
||||
.eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0,
|
||||
SysOperLog::getBusinessType, operLog.getBusinessType())
|
||||
|
||||
@@ -102,6 +102,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
validEntityBeforeSave(config);
|
||||
boolean flag = baseMapper.insert(config) > 0;
|
||||
if (flag) {
|
||||
// 从数据库查询完整的数据做缓存
|
||||
config = baseMapper.selectById(config.getOssConfigId());
|
||||
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
|
||||
}
|
||||
return flag;
|
||||
@@ -119,6 +121,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId());
|
||||
boolean flag = baseMapper.update(config, luw) > 0;
|
||||
if (flag) {
|
||||
// 从数据库查询完整的数据做缓存
|
||||
config = baseMapper.selectById(config.getOssConfigId());
|
||||
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
|
||||
}
|
||||
return flag;
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
|
||||
<resultMap id="deptResult" type="org.dromara.system.domain.vo.SysDeptVo">
|
||||
<id property="deptId" column="dept_id"/>
|
||||
<id property="email" column="dept_email"/>
|
||||
<id property="status" column="dept_status"/>
|
||||
<id property="createTime" column="dept_create_time"/>
|
||||
<result property="email" column="dept_email"/>
|
||||
<result property="status" column="dept_status"/>
|
||||
<result property="createTime" column="dept_create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleResult" type="org.dromara.system.domain.vo.SysRoleVo">
|
||||
<id property="roleId" column="role_id"/>
|
||||
<id property="status" column="role_status"/>
|
||||
<id property="createTime" column="role_create_time"/>
|
||||
<result property="status" column="role_status"/>
|
||||
<result property="createTime" column="role_create_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
|
||||
Reference in New Issue
Block a user