This commit is contained in:
ival 2019-11-14 16:45:46 +08:00
commit f9129558a6
4 changed files with 20 additions and 20 deletions

View File

@ -126,7 +126,7 @@
</el-table-column>
</template>
</el-table>
<div v-if="!queryList.selectCheckShow" style="margin-top: 8px; margin-left: 8px;">
<div v-if="queryList.selectCheckShow" style="margin-top: 8px; margin-left: 8px;">
<el-button
size="mini"
:type="'primary'"

View File

@ -16,6 +16,14 @@ function hasPermission(roles, permissionRoles) {
const whiteList = ['/login', '/design/login', '/xty/login', '/designxty/login']; // 不重定向白名单
const designPageRegex = [/^\/design/, /^\/scriptDisplay/, /^\/publish/, /^\/orderauthor/, /^\/system/, /^\/display\/record/, /^\/display\/manage/, /^\/apply/, /^\/plan/, /^\/display\/plan/];
function isDesignPage(toRoutePath) {
return designPageRegex.some(item => {
return item.test(toRoutePath);
});
}
const loginPage = whiteList[0];
const loginDesignPage = whiteList[1];
@ -32,17 +40,9 @@ function getRouteInfo(to) {
if (/^\/designxty/.test(toRoutePath)) {
loginPath = loginDesignXtyPage;
clientId = LoginParams.Design.clientId;
} else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/system/.test(toRoutePath) || /^\/display\/record/.test(toRoutePath) || /^\/display\/manage/.test(toRoutePath) || /^\/apply/.test(toRoutePath)) {
} else if (isDesignPage(toRoutePath)) {
loginPath = getSessionStorage('project') === 'designxty' ? loginDesignXtyPage : loginDesignPage;
clientId = LoginParams.Design.clientId;
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath)) {
if (getSessionStorage('project').startsWith('design')) {
loginPath = getSessionStorage('project') === 'designxty' ? loginDesignXtyPage : loginDesignPage;
clientId = LoginParams.Design.clientId;
} else {
loginPath = getSessionStorage('project') === 'xty' ? loginXtyPage : loginPage;
clientId = null;
}
} else if ( /^\/xty/.test(toRoutePath)) {
loginPath = loginXtyPage;
clientId = null;

View File

@ -134,7 +134,7 @@ export const userLesson = '012'; // 教学系统
export const userSimulation = '013'; // 仿真系统
export const userScreen = '014'; // 大屏系统
export const userPlan = '015'; // 计划系统
export const userDesign = '016'; // 设计系统
export const userTrainingPlatform = '016'; // 实训平台
// const isDev = process.env.NODE_ENV === 'development';
export const UrlConfig = {
@ -288,7 +288,7 @@ export const asyncRouter = [
component: Layout,
redirect: '/design/home',
meta: {
roles: [admin, user, userDesign]
roles: [admin, user]
},
children: [
{
@ -376,7 +376,7 @@ export const asyncRouter = [
redirect: '/design/userlist/home',
component: Layout,
meta: {
roles: [admin, user, userDesign]
roles: [admin, user]
},
children: [
{
@ -453,7 +453,7 @@ export const asyncRouter = [
component: Layout,
hidden: true,
meta: {
roles: [admin, userSimulation, user]
roles: [admin, userSimulation, user, userTrainingPlatform]
},
children: [
{
@ -550,7 +550,7 @@ export const asyncRouter = [
component: Layout,
meta: {
i18n: 'router.pulishManage',
roles: [admin, userDesign]
roles: [admin]
},
children: [
{ // 发布地图
@ -629,7 +629,7 @@ export const asyncRouter = [
component: Layout,
meta: {
i18n: 'router.orderAuthorityManage',
roles: [admin, userDesign]
roles: [admin]
},
children: [
{
@ -721,7 +721,7 @@ export const asyncRouter = [
component: Layout,
meta: {
i18n: 'router.systemManage',
roles: [admin, userDesign]
roles: [admin]
},
children: [
{
@ -820,7 +820,7 @@ export const asyncRouter = [
component: Layout,
meta: {
i18n: 'router.releaseApplication',
roles: [admin, userDesign]
roles: [admin]
},
children: [
{

View File

@ -1,4 +1,4 @@
import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userDesign } from '@/router';
import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform } from '@/router';
import { PermissionType } from '@/utils/PermissionType';
import { UrlConfig } from '@/router/index';
import { getSessionStorage } from '@/utils/auth';
@ -36,7 +36,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(userDesign) < 0;
return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userTrainingPlatform) > 0;
}
} else if (parentsRoles) {
// 如果没有本级路由,有父级路由,则使用父级路由过滤