🎨 修改 router 路径.

This commit is contained in:
lijiahang
2024-03-07 17:34:44 +08:00
parent 6a7615e294
commit 7413b7e932
13 changed files with 52 additions and 53 deletions

View File

@@ -25,12 +25,15 @@
</div>
<!-- 右侧操作 -->
<ul class="right-side">
<!-- 搜索 -->
<li v-if="false">
<a-tooltip content="搜索">
<a-button class="nav-btn" type="outline" shape="circle">
<!-- 主机终端 -->
<li v-permission="['asset:host-terminal:access']">
<a-tooltip content="主机终端">
<a-button class="nav-btn"
type="outline"
shape="circle"
@click="openNewRoute('hostTerminal')">
<template #icon>
<icon-search />
<icon-code-square />
</template>
</a-button>
</a-tooltip>
@@ -210,6 +213,7 @@
import { openAppSettingKey, toggleDrawerMenuKey } from '@/types/symbol';
import { preferenceTipsKey } from './const';
import { REDIRECT_ROUTE_NAME, routerToTag } from '@/router/constants';
import { openWindow } from '@/utils';
import Menu from '@/components/system/menu/tree/index.vue';
import UpdatePasswordModal from '@/components/user/user/update-password-modal.vue';
import MessageBox from '@/components/system/message-box/index.vue';
@@ -276,6 +280,12 @@
triggerMouseEvent(localeRef);
};
// 打开新页面
const openNewRoute = (name: string) => {
const { href } = router.resolve({ name });
openWindow(href);
};
// 刷新页面
const reloadCurrent = async () => {
if (appStore.tabBar) {

View File

@@ -11,7 +11,7 @@ export const NOT_FOUND_ROUTER_NAME = 'notFound';
export const DEFAULT_ROUTE_NAME = 'workplace';
export const DEFAULT_ROUTE_FULL_PATH = '/dashboard/workplace';
export const DEFAULT_ROUTE_FULL_PATH = '/workplace';
/**
* 路由白名单

View File

@@ -1,23 +1,21 @@
import type { AppRouteRecordRaw } from '../types';
import { DEFAULT_LAYOUT } from '../base';
const ASSET_AUDIT: AppRouteRecordRaw =
{
name: 'assetAudit',
path: '/asset-audit',
component: DEFAULT_LAYOUT,
children: [
{
name: 'assetAuditConnectLog',
path: '/asset-audit/connect-log',
component: () => import('@/views/asset-audit/connect-log/index.vue'),
},
{
name: 'assetAuditSftpLog',
path: '/asset-audit/sftp-log',
component: () => import('@/views/asset-audit/sftp-log/index.vue'),
},
],
};
const ASSET_AUDIT: AppRouteRecordRaw = {
name: 'assetAudit',
component: DEFAULT_LAYOUT,
children: [
{
name: 'assetAuditConnectLog',
path: '/connect-log',
component: () => import('@/views/asset-audit/connect-log/index.vue'),
},
{
name: 'assetAuditSftpLog',
path: '/sftp-log',
component: () => import('@/views/asset-audit/sftp-log/index.vue'),
},
],
};
export default ASSET_AUDIT;

View File

@@ -3,24 +3,23 @@ import { DEFAULT_LAYOUT } from '../base';
const ASSET: AppRouteRecordRaw = {
name: 'asset',
path: '/asset',
component: DEFAULT_LAYOUT,
children: [
{
name: 'assetHostList',
path: '/asset/host-list',
path: '/host-list',
component: () => import('@/views/asset/host-list/index.vue'),
}, {
name: 'assetHostKey',
path: '/asset/host-key',
path: '/host-key',
component: () => import('@/views/asset/host-key/index.vue'),
}, {
name: 'assetHostIdentity',
path: '/asset/host-identity',
path: '/host-identity',
component: () => import('@/views/asset/host-identity/index.vue'),
}, {
name: 'assetGrant',
path: '/asset/grant',
path: '/asset-grant',
component: () => import('@/views/asset/grant/index.vue'),
},
],

View File

@@ -3,12 +3,11 @@ import { DEFAULT_LAYOUT } from '../base';
const DASHBOARD: AppRouteRecordRaw = {
name: 'dashboard',
path: '/dashboard',
component: DEFAULT_LAYOUT,
children: [
{
name: 'workplace',
path: '/dashboard/workplace',
path: '/workplace',
component: () => import('@/views/dashboard/workplace/index.vue'),
},
],

View File

@@ -3,12 +3,11 @@ import { FULL_LAYOUT } from '../base';
const HOST: AppRouteRecordRaw = {
name: 'host',
path: '/host',
component: FULL_LAYOUT,
children: [
{
name: 'hostTerminal',
path: '/host/terminal',
path: '/terminal',
component: () => import('@/views/host/terminal/index.vue'),
meta: {
noAffix: true

View File

@@ -3,22 +3,21 @@ import { DEFAULT_LAYOUT } from '../base';
const SYSTEM: AppRouteRecordRaw = {
name: 'system',
path: '/system',
component: DEFAULT_LAYOUT,
children: [
{
name: 'systemMenu',
path: '/system/menu',
path: '/menu',
component: () => import('@/views/system/menu/index.vue'),
},
{
name: 'systemDictKey',
path: '/system/dict-key',
path: '/dict-key',
component: () => import('@/views/system/dict-key/index.vue'),
},
{
name: 'systemDictValue',
path: '/system/dict-value',
path: '/dict-value',
component: () => import('@/views/system/dict-value/index.vue'),
},
],

View File

@@ -3,27 +3,26 @@ import { DEFAULT_LAYOUT } from '../base';
const USER: AppRouteRecordRaw = {
name: 'user',
path: '/user',
component: DEFAULT_LAYOUT,
children: [
{
name: 'userRole',
path: '/user/role',
path: '/role',
component: () => import('@/views/user/role/index.vue'),
},
{
name: 'userUser',
path: '/user/user',
path: '/user',
component: () => import('@/views/user/user/index.vue'),
},
{
name: 'userInfo',
path: '/user/info',
path: '/user-info',
component: () => import('@/views/user/info/index.vue'),
},
{
name: 'userOperatorLog',
path: '/user/operator-log',
path: '/operator-log',
component: () => import('@/views/user/operator-log/index.vue'),
},
],