产品分化 设计系统调整
This commit is contained in:
parent
588c886f3b
commit
a46f94f85e
@ -10,7 +10,8 @@ export function getQuestPageList(mapId) {
|
|||||||
/** 创建任务 */
|
/** 创建任务 */
|
||||||
export function createQuest(data) {
|
export function createQuest(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script`,
|
// url: `/api/script`,
|
||||||
|
url: `/api/script/draft/create`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
@ -18,7 +19,8 @@ export function createQuest(data) {
|
|||||||
/** 根据任务id删除任务 */
|
/** 根据任务id删除任务 */
|
||||||
export function deleteQuest(id) {
|
export function deleteQuest(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/${id}`,
|
// url: `/api/script/${id}`,
|
||||||
|
url: `/api/script/draft/${id}/delete`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -39,7 +41,8 @@ export function getQuestByIdList(id) {
|
|||||||
/** 更新任务基本信息 */
|
/** 更新任务基本信息 */
|
||||||
export function updateQuest(id, data) {
|
export function updateQuest(id, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/${id}`,
|
// url: `/api/script/${id}`,
|
||||||
|
url: `/api/script/draft/${id}/update`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
|
@ -4,7 +4,8 @@ import router from './router';
|
|||||||
import NProgress from 'nprogress'; // Progress 进度条
|
import NProgress from 'nprogress'; // Progress 进度条
|
||||||
import 'nprogress/nprogress.css';// Progress 进度条样式
|
import 'nprogress/nprogress.css';// Progress 进度条样式
|
||||||
import { admin, userDesign} from './router';
|
import { admin, userDesign} from './router';
|
||||||
import { getToken, getScreenToken, getPlanToken } from '@/utils/auth'; // 验权
|
import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权
|
||||||
|
// getPlanToken
|
||||||
import { LoginParams } from '@/utils/login';
|
import { LoginParams } from '@/utils/login';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
|
|
||||||
@ -16,14 +17,15 @@ function hasPermission(roles, permissionRoles) {
|
|||||||
|
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/plan/login', '/plan/login1', '/design/login1']; // 不重定向白名单
|
// '/plan/login', '/plan/login1',
|
||||||
|
const whiteList = ['/login', '/login1', '/dp/login', '/dp/login1', '/design/login1']; // 不重定向白名单
|
||||||
|
|
||||||
const loginPage = isDev ? whiteList[1] : whiteList[0];
|
const loginPage = isDev ? whiteList[1] : whiteList[0];
|
||||||
|
|
||||||
const loginScreenPage = isDev ? whiteList[3] : whiteList[2];
|
const loginScreenPage = isDev ? whiteList[3] : whiteList[2];
|
||||||
|
|
||||||
const loginPlanPage = isDev ? whiteList[5] : whiteList[4];
|
// const loginPlanPage = isDev ? whiteList[5] : whiteList[4];
|
||||||
const loginDesignPage = isDev ? whiteList[6] : whiteList[6];
|
const loginDesignPage = isDev ? whiteList[4] : whiteList[4];
|
||||||
|
|
||||||
// 获取路径数据
|
// 获取路径数据
|
||||||
function getRouteInfo(to) {
|
function getRouteInfo(to) {
|
||||||
@ -36,13 +38,14 @@ function getRouteInfo(to) {
|
|||||||
loginPath = loginScreenPage;
|
loginPath = loginScreenPage;
|
||||||
getTokenInfo = getScreenToken;
|
getTokenInfo = getScreenToken;
|
||||||
clientId = LoginParams.DaPing.clientId;
|
clientId = LoginParams.DaPing.clientId;
|
||||||
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath) || /^\/planEdit/.test(toRoutePath)) {
|
}
|
||||||
loginPath = loginPlanPage;
|
// else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath) || /^\/planEdit/.test(toRoutePath)) {
|
||||||
getTokenInfo = getToken;
|
// loginPath = loginPlanPage;
|
||||||
clientId = LoginParams.LianJiHua.clientId;
|
// getTokenInfo = getToken;
|
||||||
} else if (/^\/design/.test(toRoutePath)) {
|
// clientId = LoginParams.LianJiHua.clientId;
|
||||||
|
else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/plan/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/orderauthor/.test(system)) {
|
||||||
loginPath = loginDesignPage;
|
loginPath = loginDesignPage;
|
||||||
getTokenInfo = getToken;
|
getTokenInfo = getDesignToken;
|
||||||
clientId = LoginParams.Design.clientId;
|
clientId = LoginParams.Design.clientId;
|
||||||
} else {
|
} else {
|
||||||
loginPath = loginPage;
|
loginPath = loginPage;
|
||||||
|
@ -132,7 +132,6 @@ const user = {
|
|||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
GetInfo({ commit }, getTokenInfo) {
|
GetInfo({ commit }, getTokenInfo) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// debugger;
|
|
||||||
getInfo(getTokenInfo()).then(response => {
|
getInfo(getTokenInfo()).then(response => {
|
||||||
const user = response.data;
|
const user = response.data;
|
||||||
if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||||
|
@ -7,7 +7,7 @@ const TokenScreenKey = 'Screen-Token';
|
|||||||
|
|
||||||
const TokenPlanKey = 'Plan-Token';
|
const TokenPlanKey = 'Plan-Token';
|
||||||
|
|
||||||
const TokenDesignKey='Admin-Token';
|
const TokenDesignKey='Design-Token';
|
||||||
|
|
||||||
// 设置教学,实训,仿真系统token
|
// 设置教学,实训,仿真系统token
|
||||||
export function getToken() {
|
export function getToken() {
|
||||||
@ -67,9 +67,13 @@ export function handleToken() {
|
|||||||
const path = window.location.href;
|
const path = window.location.href;
|
||||||
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
||||||
return getScreenToken();
|
return getScreenToken();
|
||||||
} else if (path.includes('/plan') || path.includes('/display/plan')) {
|
} else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) {
|
||||||
return getPlanToken();
|
return getDesignToken();
|
||||||
} else {
|
}
|
||||||
|
// else if (path.includes('/plan') || path.includes('/display/plan')) {
|
||||||
|
// return getPlanToken();
|
||||||
|
// }
|
||||||
|
else {
|
||||||
return getToken();
|
return getToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,8 +83,12 @@ export function handleRemoveToken() {
|
|||||||
const path = window.location.href;
|
const path = window.location.href;
|
||||||
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
||||||
return removeScreenToken();
|
return removeScreenToken();
|
||||||
} else if (path.includes('/plan') || path.includes('/display/plan')) {
|
}
|
||||||
return removePlanToken();
|
// else if (path.includes('/plan') || path.includes('/display/plan')) {
|
||||||
|
// return removePlanToken();
|
||||||
|
// }
|
||||||
|
else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) {
|
||||||
|
return removeDesignToken();
|
||||||
} else {
|
} else {
|
||||||
return removeToken();
|
return removeToken();
|
||||||
}
|
}
|
||||||
@ -92,8 +100,12 @@ export function gainClientId() {
|
|||||||
let clientId = null;
|
let clientId = null;
|
||||||
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
if (path.includes('/dp/') || path.includes('/display/dp')) {
|
||||||
clientId = LoginParams.DaPing.clientId;
|
clientId = LoginParams.DaPing.clientId;
|
||||||
} else if (path.includes('/plan') || path.includes('/display/plan')) {
|
}
|
||||||
clientId = LoginParams.LianJiHua.clientId;
|
// else if (path.includes('/plan') || path.includes('/display/plan')) {
|
||||||
|
// clientId = LoginParams.LianJiHua.clientId;
|
||||||
|
// }
|
||||||
|
else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/plan') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system')) {
|
||||||
|
clientId = LoginParams.Design.clientId;
|
||||||
}
|
}
|
||||||
|
|
||||||
return clientId;
|
return clientId;
|
||||||
|
@ -5,5 +5,5 @@ export const LoginParams = {
|
|||||||
DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统"
|
DaPing: { clientId: '2', secret: 'bigscreen' }, // "大屏系统"
|
||||||
LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划"
|
LianJiHua: { clientId: '3', secret: 'linkplan' }, // "琏计划"
|
||||||
Assistant: { clientId: '4', secret: 'linkassistant' }, // "琏课堂助手"
|
Assistant: { clientId: '4', secret: 'linkassistant' }, // "琏课堂助手"
|
||||||
Design: { clientId: '1', secret: 'joylink' } // "城市轨道交通设计平台"
|
Design: { clientId: '6', secret: 'design' } // "城市轨道交通设计平台"
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user