feat(system): 更新系统核心配置和组件
- 更新路由守卫逻辑,优化权限验证流程 - 完善静态路由配置,新增仪表盘路由 - 改进认证状态管理,优化用户状态处理 - 增强路由帮助函数,支持动态菜单生成 - 优化 CoiDialog 弹框组件功能
This commit is contained in:
parent
d6bee84581
commit
1714927ecb
@ -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<IDialogProps>(), {
|
||||
cancelText: '取消',
|
||||
fullscreen: false,
|
||||
loading: false,
|
||||
confirmDisabled: false,
|
||||
footerHidden: false,
|
||||
showConfirm: true,
|
||||
showCancel: true,
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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',
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@ -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: '',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user