|
@@ -1,4 +1,4 @@
|
|
|
-import {createRouter, createWebHistory} from 'vue-router'
|
|
|
|
|
|
|
+import {createRouter, createWebHistory} from 'vue-router'
|
|
|
import {CONFIG, refreshRoleRoute} from "@/utils/roleUtils.js";
|
|
import {CONFIG, refreshRoleRoute} from "@/utils/roleUtils.js";
|
|
|
import {Message} from "@/utils/message/Message.js";
|
|
import {Message} from "@/utils/message/Message.js";
|
|
|
import {refreshAllDictData} from "@/utils/dictUtils.js";
|
|
import {refreshAllDictData} from "@/utils/dictUtils.js";
|
|
@@ -20,6 +20,7 @@ const routes = [
|
|
|
// 免登录
|
|
// 免登录
|
|
|
{ path: '/quick-login', component: () => import('../views/QuickLogin.vue') },
|
|
{ path: '/quick-login', component: () => import('../views/QuickLogin.vue') },
|
|
|
{ path: '/promotion-login', component: () => import('../views/PromotionLogin.vue') },
|
|
{ path: '/promotion-login', component: () => import('../views/PromotionLogin.vue') },
|
|
|
|
|
+ { path: '/login-qsfl', component: () => import('../views/qsfl/LoginQsfl.vue') },
|
|
|
// //【AI实验课】登录
|
|
// //【AI实验课】登录
|
|
|
// { path: '/ai-login', component: () => import('../views/AiCourseLogin.vue') },
|
|
// { path: '/ai-login', component: () => import('../views/AiCourseLogin.vue') },
|
|
|
// //【blockly编程课】免租户登录
|
|
// //【blockly编程课】免租户登录
|
|
@@ -183,6 +184,17 @@ const routes = [
|
|
|
component: () => import('../views/programming/Interface.vue')
|
|
component: () => import('../views/programming/Interface.vue')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ // ==========【强生菲林 - AI智能问答】
|
|
|
|
|
+ {
|
|
|
|
|
+ path: '/ai-qa',
|
|
|
|
|
+ component: () => import('../views/qsfl/aiQA.vue')
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ path: '/ai-qa-new',
|
|
|
|
|
+ component: () => import('../views/qsfl/aiQANew.vue')
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 【AI实验课】首页
|
|
// 【AI实验课】首页
|
|
|
// 实验室主题
|
|
// 实验室主题
|
|
|
{
|
|
{
|
|
@@ -290,8 +302,9 @@ const router = createRouter({
|
|
|
|
|
|
|
|
// 导航守卫
|
|
// 导航守卫
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
- // 注册页面始终允许访问,不需要登录状态
|
|
|
|
|
- if ( ['/register-login',
|
|
|
|
|
|
|
+ // ======= 免登录白名单(新增的页面在此注册即可免登录访问)=======
|
|
|
|
|
+ if ( ['/login-qsfl',
|
|
|
|
|
+ '/register-login',
|
|
|
'/reg',
|
|
'/reg',
|
|
|
'/login-mobile',
|
|
'/login-mobile',
|
|
|
'/quick-login',
|
|
'/quick-login',
|
|
@@ -309,7 +322,7 @@ router.beforeEach(async (to, from, next) => {
|
|
|
|
|
|
|
|
// 如果未登录且不是允许访问的页面,重定向到登录页
|
|
// 如果未登录且不是允许访问的页面,重定向到登录页
|
|
|
if (!isLoggedIn && !allowedPages.includes(to.path)) {
|
|
if (!isLoggedIn && !allowedPages.includes(to.path)) {
|
|
|
- next('/login')
|
|
|
|
|
|
|
+ next(['/ai-qa', '/ai-qa-new'].includes(to.path) ? '/login-qsfl' : '/login')
|
|
|
return
|
|
return
|
|
|
}else if(to.path === '/sub-jump') {
|
|
}else if(to.path === '/sub-jump') {
|
|
|
next('/sub-jump')
|
|
next('/sub-jump')
|
|
@@ -349,7 +362,10 @@ router.beforeEach(async (to, from, next) => {
|
|
|
const hasManagementPermission = true // 管理界面默认允许所有登录用户访问
|
|
const hasManagementPermission = true // 管理界面默认允许所有登录用户访问
|
|
|
|
|
|
|
|
// 检查目标路由是否在允许的范围内
|
|
// 检查目标路由是否在允许的范围内
|
|
|
- if ((to.path === managementRoutes.home || managementRoutes.children.includes(to.path)) && hasManagementPermission) {
|
|
|
|
|
|
|
+ if (['/ai-qa', '/ai-qa-new'].includes(to.path)) {
|
|
|
|
|
+ // 强生菲林问答页要求已登录,但不受课程菜单角色权限限制。
|
|
|
|
|
+ isAllowed = true
|
|
|
|
|
+ } else if ((to.path === managementRoutes.home || managementRoutes.children.includes(to.path)) && hasManagementPermission) {
|
|
|
isAllowed = true
|
|
isAllowed = true
|
|
|
} else if ((to.path === homeRoutes.home || homeRoutes.children.includes(to.path)) && hasHomePermission) {
|
|
} else if ((to.path === homeRoutes.home || homeRoutes.children.includes(to.path)) && hasHomePermission) {
|
|
|
isAllowed = true
|
|
isAllowed = true
|