feat(initialization): 新增管理员权限检查和自动启动功能
- 添加 AdminCheck 组件,用于提示用户需要管理员权限 - 实现 AutoMode 组件,用于自动启动后端服务 - 更新 DependenciesStep组件,移除部分镜像源 - 注释掉路由守卫代码,暂时不启用初始化页面强制跳转
This commit is contained in:
@@ -11,7 +11,7 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/initialization',
|
||||
name: 'Initialization',
|
||||
component: () => import('../views/InitializationNew.vue'),
|
||||
component: () => import('../views/Initialization.vue'),
|
||||
meta: { title: '初始化' },
|
||||
},
|
||||
{
|
||||
@@ -89,23 +89,23 @@ const router = createRouter({
|
||||
|
||||
import { isAppInitialized } from '@/utils/config'
|
||||
|
||||
// 添加路由守卫,确保在生产环境中也能正确进入初始化页面
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
console.log('路由守卫:', { to: to.path, from: from.path })
|
||||
|
||||
// 如果访问的不是初始化页面,且没有初始化标记,则重定向到初始化页面
|
||||
if (to.path !== '/initialization') {
|
||||
const initialized = await isAppInitialized()
|
||||
console.log('检查初始化状态:', initialized)
|
||||
|
||||
if (!initialized) {
|
||||
console.log('应用未初始化,重定向到初始化页面')
|
||||
next('/initialization')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
next()
|
||||
})
|
||||
// // 添加路由守卫,确保在生产环境中也能正确进入初始化页面
|
||||
// router.beforeEach(async (to, from, next) => {
|
||||
// console.log('路由守卫:', { to: to.path, from: from.path })
|
||||
//
|
||||
// // 如果访问的不是初始化页面,且没有初始化标记,则重定向到初始化页面
|
||||
// if (to.path !== '/initialization') {
|
||||
// const initialized = await isAppInitialized()
|
||||
// console.log('检查初始化状态:', initialized)
|
||||
//
|
||||
// if (!initialized) {
|
||||
// console.log('应用未初始化,重定向到初始化页面')
|
||||
// next('/initialization')
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// next()
|
||||
// })
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user