diff --git a/src/router/index_Common.js b/src/router/index_Common.js index 87eabad31..ca11e1bd6 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -151,6 +151,7 @@ export const mapCreater = '02'; // 地图创建权限 export const lessonCreater = '03'; // 课程创建权限 export const admin = '04'; // 管理员 export const superAdmin = '05'; // 超级管理员 +export const referee = '07'; // 裁判员 export const userExam = '011'; // 考试系统 export const userLesson = '012'; // 教学系统 @@ -982,13 +983,13 @@ export const asyncRouter = [ ] } ]; -const JSXT = [ +export const JSXT = [ { path: '/jsxt', component: Layout, meta: { i18n: 'router.competitionManage', - roles: [user, userTrainingPlatform] + roles: [user, userTrainingPlatform, referee] }, pathStr: 'jsxt', hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('jsxt') && !window.document.location.pathname.includes('jsxt') : !window.document.location.pathname.includes('jsxt'), @@ -1009,7 +1010,7 @@ const JSXT = [ component: Layout, meta: { i18n: 'router.refereeJManage', - roles: [admin, userTrainingPlatform] + roles: [referee, userTrainingPlatform] }, pathStr: 'refereeJsxt', hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'), @@ -1036,11 +1037,6 @@ const router = createRouter(); router.beforeEach((to, from, next) => { const project = getSessionStorage('project'); - JSXT.forEach(route => { - if (from.path.includes(route.pathStr)) { - asyncRouter.push(route); - } - }); document.title = loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title; next(); }); diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 88f8ca94d..0e5598c55 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -37,7 +37,8 @@ export default { { label: '课程生成者', value: '03' }, { label: '系统管理员', value: '04' }, { label: '超级管理员', value: '05' }, - { label: '销售用户', value: '06' } + { label: '销售用户', value: '06' }, + { label: '裁判员', value: '07' } ], examResultList: [ diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 7a7958541..03bbc159e 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,4 +1,4 @@ -import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform } from '@/router/index_APP_TARGET'; +import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform, JSXT } from '@/router/index_APP_TARGET'; import { PermissionType } from '@/utils/PermissionType'; import { UrlConfig } from '@/scripts/ConstDic'; import { getSessionStorage } from '@/utils/auth'; @@ -35,7 +35,7 @@ function hasPermission(roles, route, parentsRoles) { roles = roles.filter(function (role) { return route.meta.roles.indexOf(role) >= 0; }); - return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userTrainingPlatform) > 0; + return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userTrainingPlatform) >= 0; } } else if (parentsRoles) { // 如果没有本级路由,有父级路由,则使用父级路由过滤 @@ -104,8 +104,9 @@ const permission = { if (roles.indexOf(superAdmin) >= 0 && roles.indexOf(admin) < 0) { roles.push(admin); } + const routeArr = [...asyncRouter, ...JSXT]; - const accessedRouters = filterAsyncRouter(asyncRouter, roles); + const accessedRouters = filterAsyncRouter(routeArr, roles); accessedRouters.forEach(route => { if (route.children && route.children.length == 0) { route.hidden = true; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index d52813076..91d273d7d 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,9 +1,9 @@ import { setSessionStorage } from '@/utils/auth'; import { login, logout, getInfo } from '@/api/login'; -import { getToken, setToken, removeToken } from '@/utils/auth'; +import { getToken, setToken, removeToken, removeSessionStorage } from '@/utils/auth'; import { getUserConfigInfo } from '@/api/management/user'; import { LoginParams } from '@/utils/login'; -import { creatSubscribe, clearSubscribe, perpetualTopic, commonTopic, disconnect} from '@/utils/stomp'; +import { creatSubscribe, clearSubscribe, perpetualTopic, disconnect} from '@/utils/stomp'; import Cookies from 'js-cookie'; const user = { @@ -145,6 +145,7 @@ const user = { commit('SET_ID', ''); commit('SET_ROLES', []); removeToken(); + removeSessionStorage('project'); }, // 登出系统 diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 080406116..4ff00eac2 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - BASE_API = 'http://192.168.3.6:9000'; // 旭强 + // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.41:9000'; // 张S赛 diff --git a/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue b/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue index f4a541799..4022d6933 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue @@ -208,10 +208,10 @@ export default { roadType: selected.roadType, firstTurnBack: false, belongStation: '', - rightAxleOffset: {x:0, y:0}, - leftAxleOffset: {x:0, y:0}, - leftAxlePosition: 0, - rightAxlePosition: 0, + rightAxleOffset: {x:0, y:0}, + leftAxleOffset: {x:0, y:0}, + leftAxlePosition: 0, + rightAxlePosition: 0 }; models.push(model); } @@ -291,10 +291,10 @@ export default { roadType: null, firstTurnBack: false, belongStation: '', - rightAxleOffset: {x:0, y:0}, - leftAxleOffset: {x:0, y:0}, - leftAxlePosition: 0, - rightAxlePosition: 0, + rightAxleOffset: {x:0, y:0}, + leftAxleOffset: {x:0, y:0}, + leftAxlePosition: 0, + rightAxlePosition: 0 }; models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](lsection.code), { _dispose: true })); models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.code), { _dispose: true }));