diff --git a/backend/app/service/docker.go b/backend/app/service/docker.go index 36f83a448..c3bdb9fd1 100644 --- a/backend/app/service/docker.go +++ b/backend/app/service/docker.go @@ -40,10 +40,10 @@ type daemonJsonItem struct { func (u *DockerService) LoadDockerStatus() string { status := constant.StatusRunning - // stdout, err := cmd.Exec("systemctl is-active docker") - // if string(stdout) != "active\n" || err != nil { - // status = constant.Stopped - // } + stdout, err := cmd.Exec("systemctl is-active docker") + if string(stdout) != "active\n" || err != nil { + status = constant.Stopped + } return status } diff --git a/frontend/src/api/helper/check-status.ts b/frontend/src/api/helper/check-status.ts index 138e9a04a..3c60b2de5 100644 --- a/frontend/src/api/helper/check-status.ts +++ b/frontend/src/api/helper/check-status.ts @@ -16,7 +16,7 @@ export const checkStatus = (status: number): void => { MsgError(i18n.global.t('commons.res.notFound')); break; case 403: - router.replace({ path: '/login' }); + router.replace({ path: '/' }); MsgError(i18n.global.t('commons.res.forbidden')); break; case 500: diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 21186cf66..953f34063 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -44,13 +44,13 @@ class RequestHttp { } if (data.code == ResultEnum.OVERDUE || data.code == ResultEnum.FORBIDDEN) { router.replace({ - path: '/login', + path: '/', }); return Promise.reject(data); } if (data.code == ResultEnum.UNSAFETY) { router.replace({ - path: '/login', + path: '/', }); return data; } diff --git a/frontend/src/config/config.ts b/frontend/src/config/config.ts index 062f02bb4..2702b36bc 100644 --- a/frontend/src/config/config.ts +++ b/frontend/src/config/config.ts @@ -1,4 +1,4 @@ // ? 全局不动配置项 只做导出不做修改 // * 首页地址(默认) -export const HOME_URL: string = '/home/index'; +export const HOME_URL: string = '/home'; diff --git a/frontend/src/routers/index.ts b/frontend/src/routers/index.ts index 24ea87862..973cd294f 100644 --- a/frontend/src/routers/index.ts +++ b/frontend/src/routers/index.ts @@ -17,7 +17,7 @@ router.beforeEach((to, from, next) => { const globalStore = GlobalStore(); if (!globalStore.isLogin) { next({ - path: '/login', + path: '/', }); NProgress.done(); return; diff --git a/frontend/src/routers/router.ts b/frontend/src/routers/router.ts index ae9d31615..8946da5df 100644 --- a/frontend/src/routers/router.ts +++ b/frontend/src/routers/router.ts @@ -4,9 +4,9 @@ import { Layout } from '@/routers/constant'; const modules = import.meta.globEager('./modules/*.ts'); const homeRouter: RouteRecordRaw = { - path: '/', + path: '/home', component: Layout, - redirect: '/home/index', + redirect: '/home', meta: { keepAlive: true, title: 'menu.home', @@ -14,7 +14,7 @@ const homeRouter: RouteRecordRaw = { }, children: [ { - path: '/home/index', + path: '/home', name: 'home', component: () => import('@/views/home/index.vue'), }, @@ -55,7 +55,7 @@ menuList.unshift(homeRouter); export const routes: RouteRecordRaw[] = [ homeRouter, { - path: '/login/:code?', + path: '/', name: 'login', props: true, component: () => import('@/views/login/index.vue'), diff --git a/frontend/src/store/modules/menu.ts b/frontend/src/store/modules/menu.ts index 258af1cd0..be618ced4 100644 --- a/frontend/src/store/modules/menu.ts +++ b/frontend/src/store/modules/menu.ts @@ -2,7 +2,7 @@ import { defineStore } from 'pinia'; import { MenuState } from '../interface'; import piniaPersistConfig from '@/config/pinia-persist'; import { RouteRecordRaw } from 'vue-router'; -const whiteList = ['/login', '/error']; +const whiteList = ['/', '/error']; export const MenuStore = defineStore({ id: 'MenuState', diff --git a/frontend/src/views/home/index.vue b/frontend/src/views/home/index.vue index 3e8909263..3d862c513 100644 --- a/frontend/src/views/home/index.vue +++ b/frontend/src/views/home/index.vue @@ -4,7 +4,7 @@ :buttons="[ { label: i18n.global.t('menu.home'), - path: '/home/index', + path: '/home', }, ]" /> diff --git a/frontend/src/views/setting/safe/index.vue b/frontend/src/views/setting/safe/index.vue index 469ee8a5b..21709a303 100644 --- a/frontend/src/views/setting/safe/index.vue +++ b/frontend/src/views/setting/safe/index.vue @@ -231,7 +231,7 @@ const onSavePort = async (formEl: FormInstance | undefined, key: string, val: an MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); let href = window.location.href; let ip = href.split('//')[1].split(':')[0]; - window.open(`${href.split('//')[0]}//${ip}:${val}/login`, '_self'); + window.open(`${href.split('//')[0]}//${ip}:${val}/`, '_self'); }) .catch(() => { loading.value = false;