feat(system): 更新系统核心配置和组件

- 更新路由守卫逻辑,优化权限验证流程
- 完善静态路由配置,新增仪表盘路由
- 改进认证状态管理,优化用户状态处理
- 增强路由帮助函数,支持动态菜单生成
- 优化 CoiDialog 弹框组件功能
This commit is contained in:
Leo 2025-09-25 16:00:10 +08:00
parent d6bee84581
commit 1714927ecb
5 changed files with 7 additions and 15 deletions

View File

@ -52,6 +52,7 @@
type="primary" type="primary"
size="medium" size="medium"
:loading="confirmLoading" :loading="confirmLoading"
:disabled="confirmDisabled"
@click="handleConfirm" @click="handleConfirm"
> >
{{ confirmText }} {{ confirmText }}
@ -83,6 +84,8 @@ interface IDialogProps {
fullscreen?: boolean fullscreen?: boolean
/** 确认按钮加载状态 */ /** 确认按钮加载状态 */
loading?: boolean loading?: boolean
/** 确认按钮禁用状态 */
confirmDisabled?: boolean
/** 隐藏底部按钮 */ /** 隐藏底部按钮 */
footerHidden?: boolean footerHidden?: boolean
/** 显示确认按钮 */ /** 显示确认按钮 */
@ -108,6 +111,7 @@ const props = withDefaults(defineProps<IDialogProps>(), {
cancelText: '取消', cancelText: '取消',
fullscreen: false, fullscreen: false,
loading: false, loading: false,
confirmDisabled: false,
footerHidden: false, footerHidden: false,
showConfirm: true, showConfirm: true,
showCancel: true, showCancel: true,

View File

@ -96,7 +96,7 @@ export function setupRouterGuard(router: Router) {
// 如果用户已登录且访问login页面重定向到首页 // 如果用户已登录且访问login页面重定向到首页
if (to.name === 'login' && isLogin) { if (to.name === 'login' && isLogin) {
next({ path: '/' }) next({ path: import.meta.env.VITE_HOME_PATH || '/dashboard' })
return return
} }

View File

@ -1,16 +1,4 @@
export const staticRoutes: AppRoute.RowRoute[] = [ 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', // name: 'personal-center',
// path: '/personal-center', // path: '/personal-center',

View File

@ -124,7 +124,7 @@ export const useAuthStore = defineStore('auth-store', {
coiMsgSuccess('登录成功!') coiMsgSuccess('登录成功!')
router.push({ router.push({
path: query.redirect || '/', path: query.redirect || import.meta.env.VITE_HOME_PATH || '/dashboard',
}) })
}, },

View File

@ -140,7 +140,7 @@ export function createRoutes(routeData: (AppRoute.BackendRoute | AppRoute.RowRou
const appRootRoute: RouteRecordRaw = { const appRootRoute: RouteRecordRaw = {
path: '/appRoot', path: '/appRoot',
name: 'appRoot', name: 'appRoot',
redirect: import.meta.env.VITE_HOME_PATH || '/dashboard/monitor', redirect: import.meta.env.VITE_HOME_PATH || '/dashboard',
component: Layout, component: Layout,
meta: { meta: {
title: '', title: '',