🔨 优化代码逻辑.
This commit is contained in:
@@ -29,7 +29,6 @@ import cn.orionsec.kit.lang.utils.collect.Maps;
|
||||
import cn.orionsec.kit.lang.utils.crypto.Keys;
|
||||
import cn.orionsec.kit.lang.utils.crypto.RSA;
|
||||
import cn.orionsec.kit.spring.SpringHolder;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.visor.common.constant.AppConst;
|
||||
import org.dromara.visor.common.constant.ConfigKeys;
|
||||
@@ -124,28 +123,12 @@ public class SystemSettingServiceImpl implements SystemSettingService {
|
||||
|
||||
@Override
|
||||
public void updateSystemSetting(SystemSettingUpdateRequest request) {
|
||||
String type = request.getType();
|
||||
String configKey = request.getConfigKey();
|
||||
String value = request.getValue();
|
||||
// 删除
|
||||
systemSettingDAO.delete(Conditions.eq(SystemSettingDO::getConfigKey, configKey));
|
||||
// 插入
|
||||
SystemSettingDO insert = SystemSettingDO.builder()
|
||||
.type(type)
|
||||
.configKey(configKey)
|
||||
.value(Strings.def(value))
|
||||
SystemSettingUpdateBatchRequest params = SystemSettingUpdateBatchRequest.builder()
|
||||
.type(request.getType())
|
||||
.settings(Maps.of(request.getConfigKey(), request.getValue()))
|
||||
.build();
|
||||
systemSettingDAO.insert(insert);
|
||||
// 更新
|
||||
SystemSettingDO update = new SystemSettingDO();
|
||||
update.setValue(value);
|
||||
LambdaQueryWrapper<SystemSettingDO> wrapper = systemSettingDAO.lambda()
|
||||
.eq(SystemSettingDO::getConfigKey, configKey);
|
||||
systemSettingDAO.update(update, wrapper);
|
||||
// 删除缓存
|
||||
RedisUtils.delete(SystemSettingKeyDefine.SETTING);
|
||||
// 触发修改事件
|
||||
SpringHolder.publishEvent(ConfigUpdateEvent.of(configKey, value));
|
||||
this.updateSystemSettingBatch(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ const MONITOR: AppRouteRecordRaw = {
|
||||
component: () => import('@/views/monitor/alarm-policy/index.vue'),
|
||||
},
|
||||
{
|
||||
name: 'alarmEvent',
|
||||
name: 'hostAlarmEvent',
|
||||
path: '/monitor/alarm-event',
|
||||
component: () => import('@/views/monitor/alarm-event/index.vue'),
|
||||
},
|
||||
|
||||
@@ -7,12 +7,12 @@ const USER: AppRouteRecordRaw = {
|
||||
component: DEFAULT_LAYOUT,
|
||||
children: [
|
||||
{
|
||||
name: 'role',
|
||||
name: 'userRole',
|
||||
path: '/user/role',
|
||||
component: () => import('@/views/user/role/index.vue'),
|
||||
},
|
||||
{
|
||||
name: 'user',
|
||||
name: 'userList',
|
||||
path: '/user/list',
|
||||
component: () => import('@/views/user/user/index.vue'),
|
||||
},
|
||||
@@ -26,6 +26,16 @@ const USER: AppRouteRecordRaw = {
|
||||
path: '/user/operator-log',
|
||||
component: () => import('@/views/user/operator-log/index.vue'),
|
||||
},
|
||||
{
|
||||
name: 'userSession',
|
||||
path: '/user/session',
|
||||
component: () => import('@/views/user/user-session/index.vue'),
|
||||
},
|
||||
{
|
||||
name: 'lockedUser',
|
||||
path: '/user/locked',
|
||||
component: () => import('@/views/user/locked-user/index.vue'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
import WindowsIcon from '@/assets/images/icon/os_windows.svg';
|
||||
import LinuxIcon from '@/assets/images/icon/os_linux.svg';
|
||||
import DarwinIcon from '@/assets/images/icon/os_darwin.svg';
|
||||
import { TagColors } from '@/types/const';
|
||||
|
||||
// 表名称
|
||||
export const TableName = 'host';
|
||||
|
||||
// tag 颜色
|
||||
export const tagColor = [
|
||||
'arcoblue',
|
||||
'green',
|
||||
'purple',
|
||||
'pinkpurple',
|
||||
'magenta'
|
||||
];
|
||||
export const tagColor = TagColors;
|
||||
|
||||
// 主机类型
|
||||
export const HostType = {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'role'
|
||||
name: 'userRole'
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'user'
|
||||
name: 'userList'
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user