diff --git a/src/global.d.ts b/src/global.d.ts
index e99fad98..ab0b37b5 100644
--- a/src/global.d.ts
+++ b/src/global.d.ts
@@ -52,15 +52,15 @@ declare namespace Settings {
*/
routeBaseOn?: 'frontend' | 'backend' | 'filesystem'
}
- interface dashboard {
+ interface home {
/**
- * 是否开启控制台页面
+ * 是否开启主页页面
* @默认值 `true`
*/
enable?: boolean
/**
- * 控制台名称
- * @默认值 `'控制台'`
+ * 主页名称
+ * @默认值 `'主页'`
*/
title?: string
}
@@ -189,8 +189,8 @@ declare namespace Settings {
interface all {
/** 应用设置 */
app?: app
- /** 控制台设置 */
- dashboard?: dashboard
+ /** 主页设置 */
+ home?: home
/** 布局设置 */
layout?: layout
/** 导航栏设置 */
diff --git a/src/layouts/components/AppSetting/index.vue b/src/layouts/components/AppSetting/index.vue
index 7e5ba0e9..33bd8553 100644
--- a/src/layouts/components/AppSetting/index.vue
+++ b/src/layouts/components/AppSetting/index.vue
@@ -226,23 +226,23 @@ function handleCopy() {
- 控制台
+ 主页
其它
diff --git a/src/layouts/components/Logo/index.vue b/src/layouts/components/Logo/index.vue
index bdcd2283..4089f685 100644
--- a/src/layouts/components/Logo/index.vue
+++ b/src/layouts/components/Logo/index.vue
@@ -22,15 +22,15 @@ const to = computed(() => {
const rtn: {
name?: string
} = {}
- if (settingsStore.dashboard.enable) {
- rtn.name = 'dashboard'
+ if (settingsStore.home.enable) {
+ rtn.name = 'home'
}
return rtn
})
-
+
{{ title }}
diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue
index ae803be3..a668862a 100644
--- a/src/layouts/components/Tools/index.vue
+++ b/src/layouts/components/Tools/index.vue
@@ -12,11 +12,11 @@ const userStore = useUserStore()
const mainPage = useMainPage()
const { isFullscreen, toggle } = useFullscreen()
-function userCommand(command: 'dashboard' | 'setting' | 'hotkeys' | 'logout') {
+function userCommand(command: 'home' | 'setting' | 'hotkeys' | 'logout') {
switch (command) {
- case 'dashboard':
+ case 'home':
router.push({
- name: 'dashboard',
+ name: 'home',
})
break
case 'setting':
@@ -85,8 +85,8 @@ function pro() {
-
- 控制台
+
+ {{ settingsStore.home.title }}
个人设置
diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue
index 828ab656..c8abb121 100644
--- a/src/layouts/components/Topbar/index.vue
+++ b/src/layouts/components/Topbar/index.vue
@@ -16,10 +16,10 @@ const enableSubMenuCollapseButton = computed(() => {
const breadcrumbList = computed(() => {
const breadcrumbList = []
- if (settingsStore.dashboard.enable) {
+ if (settingsStore.home.enable) {
breadcrumbList.push({
- path: '/dashboard',
- title: settingsStore.dashboard.title,
+ path: '/',
+ title: settingsStore.home.title,
})
}
if (route.meta.breadcrumbNeste) {
diff --git a/src/router/index.ts b/src/router/index.ts
index 6015c871..44b946eb 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -30,22 +30,22 @@ router.beforeEach(async (to, from, next) => {
if (routeStore.isGenerate) {
// 导航栏如果不是 single 模式,则需要根据 path 定位主导航的选中状态
settingsStore.menu.menuMode !== 'single' && menuStore.setActived(to.path)
- // 如果已登录状态下,进入登录页会强制跳转到控制台页面
+ // 如果已登录状态下,进入登录页会强制跳转到主页
if (to.name === 'login') {
next({
- name: 'dashboard',
+ name: 'home',
replace: true,
})
}
- // 如果未开启控制台,但进入的是控制台页面,则会进入侧边栏导航第一个模块
- else if (!settingsStore.dashboard.enable && to.name === 'dashboard') {
+ // 如果未开启主页,但进入的是主页,则会进入侧边栏导航第一个模块
+ else if (!settingsStore.home.enable && to.name === 'home') {
if (menuStore.sidebarMenus.length > 0) {
next({
path: menuStore.sidebarMenusFirstDeepestPath,
replace: true,
})
}
- // 如果侧边栏导航第一个模块无法命中,则还是进入控制台页面
+ // 如果侧边栏导航第一个模块无法命中,则还是进入主页
else {
next()
}
@@ -104,7 +104,7 @@ router.beforeEach(async (to, from, next) => {
next({
name: 'login',
query: {
- redirect: to.fullPath,
+ redirect: to.fullPath !== '/' ? to.fullPath : undefined,
},
})
}
diff --git a/src/router/routes.ts b/src/router/routes.ts
index 0a9cbd03..e613a666 100644
--- a/src/router/routes.ts
+++ b/src/router/routes.ts
@@ -7,13 +7,6 @@ import useSettingsStore from '@/store/modules/settings'
// 固定路由(默认路由)
const constantRoutes: Route.recordRaw[] = [
- {
- path: '/',
- redirect: '/dashboard',
- meta: {
- title: '',
- },
- },
{
path: '/login',
name: 'login',
@@ -35,33 +28,31 @@ const constantRoutes: Route.recordRaw[] = [
// 系统路由
const systemRoutes: Route.recordRaw[] = [
{
- path: '/dashboard',
+ path: '/',
component: () => import('@/layouts/index.vue'),
meta: {
- title: () => useSettingsStore().dashboard.title,
+ title: () => useSettingsStore().home.title,
breadcrumb: false,
},
children: [
{
path: '',
- name: 'dashboard',
+ name: 'home',
component: () => import('@/views/index.vue'),
meta: {
- title: () => useSettingsStore().dashboard.title,
+ title: () => useSettingsStore().home.title,
+ breadcrumb: false,
+ },
+ },
+ {
+ path: 'reload',
+ name: 'reload',
+ component: () => import('@/views/reload.vue'),
+ meta: {
+ title: '重新加载',
breadcrumb: false,
},
},
- ],
- },
- {
- path: '/personal',
- component: () => import('@/layouts/index.vue'),
- redirect: '/personal/setting',
- meta: {
- title: '个人中心',
- breadcrumb: false,
- },
- children: [
{
path: 'setting',
name: 'personalSetting',
@@ -81,25 +72,6 @@ const systemRoutes: Route.recordRaw[] = [
},
],
},
- {
- path: '/reload',
- component: () => import('@/layouts/index.vue'),
- meta: {
- title: '重新加载',
- breadcrumb: false,
- },
- children: [
- {
- path: '',
- name: 'reload',
- component: () => import('@/views/reload.vue'),
- meta: {
- title: '重新加载',
- breadcrumb: false,
- },
- },
- ],
- },
]
// 动态路由(异步路由、导航栏路由)
diff --git a/src/settings.default.ts b/src/settings.default.ts
index 99c4ad49..cd1c4a6f 100644
--- a/src/settings.default.ts
+++ b/src/settings.default.ts
@@ -12,9 +12,9 @@ const globalSettingsDefault: RecursiveRequired = {
enableDynamicTitle: false,
routeBaseOn: 'frontend',
},
- dashboard: {
+ home: {
enable: true,
- title: '控制台',
+ title: '主页',
},
layout: {
enableMobileAdaptation: false,
diff --git a/src/views/index.vue b/src/views/index.vue
index 69d5b4ea..a52b363a 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -1,7 +1,7 @@
-name: dashboard
+name: home
meta:
- title: 控制台
+ title: 主页