diff --git a/src/components/common/CoiDialog.vue b/src/components/common/CoiDialog.vue index 7fc8a1b..1249eb3 100644 --- a/src/components/common/CoiDialog.vue +++ b/src/components/common/CoiDialog.vue @@ -52,6 +52,7 @@ type="primary" size="medium" :loading="confirmLoading" + :disabled="confirmDisabled" @click="handleConfirm" > {{ confirmText }} @@ -83,6 +84,8 @@ interface IDialogProps { fullscreen?: boolean /** 确认按钮加载状态 */ loading?: boolean + /** 确认按钮禁用状态 */ + confirmDisabled?: boolean /** 隐藏底部按钮 */ footerHidden?: boolean /** 显示确认按钮 */ @@ -108,6 +111,7 @@ const props = withDefaults(defineProps(), { cancelText: '取消', fullscreen: false, loading: false, + confirmDisabled: false, footerHidden: false, showConfirm: true, showCancel: true, diff --git a/src/router/guard.ts b/src/router/guard.ts index 18db121..d0e4a75 100644 --- a/src/router/guard.ts +++ b/src/router/guard.ts @@ -96,7 +96,7 @@ export function setupRouterGuard(router: Router) { // 如果用户已登录且访问login页面,重定向到首页 if (to.name === 'login' && isLogin) { - next({ path: '/' }) + next({ path: import.meta.env.VITE_HOME_PATH || '/dashboard' }) return } diff --git a/src/router/routes.static.ts b/src/router/routes.static.ts index 2e6b24a..02bd05a 100644 --- a/src/router/routes.static.ts +++ b/src/router/routes.static.ts @@ -1,16 +1,4 @@ export const staticRoutes: AppRoute.RowRoute[] = [ - { - name: 'monitor', - path: '/dashboard/monitor', - title: '仪表盘', - requiresAuth: true, - icon: 'icon-park-outline:dashboard-one', - menuType: '2', - componentPath: '/dashboard/monitor/index', - id: 3, - pid: null, - pinTab: true, - }, // { // name: 'personal-center', // path: '/personal-center', diff --git a/src/store/auth.ts b/src/store/auth.ts index 1192334..a68156d 100644 --- a/src/store/auth.ts +++ b/src/store/auth.ts @@ -124,7 +124,7 @@ export const useAuthStore = defineStore('auth-store', { coiMsgSuccess('登录成功!') router.push({ - path: query.redirect || '/', + path: query.redirect || import.meta.env.VITE_HOME_PATH || '/dashboard', }) }, diff --git a/src/store/router/helper.ts b/src/store/router/helper.ts index 3e340a3..08b59e2 100644 --- a/src/store/router/helper.ts +++ b/src/store/router/helper.ts @@ -140,7 +140,7 @@ export function createRoutes(routeData: (AppRoute.BackendRoute | AppRoute.RowRou const appRootRoute: RouteRecordRaw = { path: '/appRoot', name: 'appRoot', - redirect: import.meta.env.VITE_HOME_PATH || '/dashboard/monitor', + redirect: import.meta.env.VITE_HOME_PATH || '/dashboard', component: Layout, meta: { title: '',