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