From 709299ed64c91a89af18e83c797f9cb439e70054 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 13 Oct 2021 17:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=81=8C=E7=AB=99=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=9C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/setting.js | 213 ++++++++++++++++++------------------------------- 1 file changed, 76 insertions(+), 137 deletions(-) diff --git a/src/setting.js b/src/setting.js index cf61f10..6c0b78d 100644 --- a/src/setting.js +++ b/src/setting.js @@ -1,160 +1,99 @@ /** * 业务配置 * */ - -const isDev = process.env.NODE_ENV === "development"; const url = location.host; -const isHh = url.includes("10.196.131.73"); //是否是河海版本 -const isBeta = isDev || url.includes("120.78.198.231"); //是否是职站测试 +const isDev = process.env.NODE_ENV === "development"; // 开发环境 +const isHh = url.includes("10.196.131.73"); //是否河海版本 +const isCH = url.includes("120.78.127.12"); //是否巢湖版本 +const isBeta = url.includes("120.78.198.231"); //是否职站测试 +const isPro = url.includes("occupationlab.com"); //是否职站生产 +const isTest = url.includes('39.108.250.202'); //是否中台测试服 + +let defaultSubSystem = ""; +let host = ""; +let title = ""; +let schoolId = null; +let systemList = []; + +if (isHh) { + // 河海 + host = "http://10.196.131.73/"; + defaultSubSystem = "http://10.196.131.73/pyTrials/#/"; + title = "学生端"; + schoolId = 729; +} else if (isCH) { + // 巢湖 + host = "http://120.78.127.12/"; + defaultSubSystem = "http://120.78.127.12/pyTrials/#/"; + title = "学生端"; + schoolId = 1006; +} else if (isBeta) { + // 职站测试 + host = "http://120.78.198.231/"; + defaultSubSystem = "http://120.78.198.231/pyTrials/#/"; + title = "职站"; + schoolId = 2105; +} else if (isPro) { + // 职站生产 + host = "http://www.occupationlab.com/"; + defaultSubSystem = "http://www.occupationlab.com/pyTrials/#/"; + title = "职站"; + schoolId = 2105; +} else if (isTest){ + host = "http://39.108.250.202:9000/"; + defaultSubSystem = "http://39.108.250.202/pyTrials/#/"; + title = "职站"; + schoolId = 2105; +} else if (isDev) { + // host = "http://39.108.250.202:9000/"; // 中台测试服 + // host = "http://192.168.31.151:9000/"; // 榕 + host = "http://192.168.31.125:9000/"; // 坤 + defaultSubSystem = "http://39.108.250.202/pyTrials/#/"; + title = "职站"; + schoolId = 2105; +} else { + console.log("其它版本"); +} const Setting = { /** * 基础配置 * */ - // 网页标题的后缀 - titleSuffix: isHh ? "学生端" : "职站", - // 路由模式,可选值为 history 或 hash - routerMode: "hash", - // 页面切换时,是否显示模拟的进度条 - showProgressBar: true, - // 接口请求地址 - apiBaseURL: (isBeta) ? "http://120.78.198.231/" : (isHh ? "http://10.196.131.73/" : "http://www.occupationlab.com/"), - // 是否是河海版本 - isHh, - // 是否职站测试服 - isBeta, - // 学校id,河海为729,职站为2105 - schoolId: isHh ? 729 : 2105, + titleSuffix: title, // 网页标题的后缀 + routerMode: "hash", // 路由模式,可选值为 history 或 hash + showProgressBar: true, // 页面切换时,是否显示模拟的进度条 + apiBaseURL: host, // 接口请求地址 + isHh, // 是否是河海版本 + isCH, // 是否是巢湖版本 + isBeta, // 是否职站测试服 + schoolId,// 学校id // 测评做完后跳转的默认子系统 - defaultSubSystem: (isBeta) ? "http://120.78.198.231/pyTrials/#/" : (isHh ? "http://10.196.131.73/pyTrials/#/" : "http://www.occupationlab.com/pyTrials/#/"), - // 默认系统id - systemId: 1, + defaultSubSystem, + systemId: systemList.length && systemList[0].id, // 默认系统id // 子系统列表.改的时候留意要改的是哪个环境,别影响到了其他环境 // 以后如果卖给了其他学校,要给该学校单独开放子系统的话,就在下面这个数组里加判断就行,然后把需要开放的子系统放出来。不要复制这个职站项目另起一个项目,这样学校一多就很难维护了 - systemList: isHh - // 河海版 - ? [{ - id: 1, - label: "Python程序设计教学系统" - }, { - id: 4, - label: "经济金融建模实验教学系统" - }, { - id: 6, - label: "金融随机过程实验教学系统" - }, { - id: 7, - label: "量化投资策略建模实验教学系统" - }, { - id: 8, - label: "大数据分析实验教学系统" - }] - - // 职站测试服 - : (isBeta - ? [{ - id: 1, - label: "Python程序设计教学系统" - } - // 下面这两个是川大和科大子系统,目前没有在职站开启,只有在科大川大才会开放对应的子系统 - // ,{ - // id: 2, - // label: '跨国仿真系统' - // },{ - // id: 3, - // label: '期权期货系统' - // } - , { - id: 4, - label: "经济金融建模实验教学系统" - }, { - id: 5, - label: "Python可视化实验教学系统" - }, { - id: 6, - label: "金融随机过程实验教学系统" - }, { - id: 7, - label: "量化投资策略建模实验教学系统" - }, { - id: 8, - label: "大数据分析实验教学系统" - }, { - id: 9, - label: "Python数据清洗教学实验系统" - }, { - id: 10, - label: "Python数据采集(爬虫)教学实验系统" - }] - - // 职站正式服 - : [{ - id: 1, - label: "Python程序设计教学系统" - }, { - id: 4, - label: "经济金融建模实验教学系统" - }, { - id: 5, - label: "Python可视化实验教学系统" - }, { - id: 6, - label: "金融随机过程实验教学系统" - }, { - id: 7, - label: "量化投资策略建模实验教学系统" - }, { - id: 8, - label: "大数据分析实验教学系统" - }, { - id: 9, - label: "Python数据清洗教学实验系统" - }, { - id: 10, - label: "Python数据采集(爬虫)教学实验系统" - }]), - // 长时间未操作,自动退出登录时间 - autoLogoutTime: 3600000, - // 接口请求返回错误时,弹窗的持续时间,单位:秒 - modalDuration: 3, - // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice - errorModalType: "Message", - // Cookies 默认保存时间,单位:天 - cookiesExpires: 1, - // token在localStorage的时间(毫秒) - tokenExpires: 1296000000, - /** - * localStorage里保存的token的key - */ - tokenKey: "oc_client_token", - /** - * localStorage里保存的vuex的key - */ - storeKey: "oc_client_store", - /** - * 默认密码 - */ - initialPassword: "111aaa", + systemList, + autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间 + modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 + errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice + cookiesExpires: 1, // Cookies 默认保存时间,单位:天 + tokenExpires: 1296000000, // token在localStorage的时间(毫秒) + tokenKey: "oc_client_token", // localStorage里保存的token的key + storeKey: "oc_client_store", // localStorage里保存的vuex的key + initialPassword: "111aaa", // 默认密码 /** * 多语言配置 * */ i18n: { - // 默认语言 - default: "zh", - // 是否根据用户电脑配置自动设置语言(仅第一次有效) - auto: false + default: "zh", // 默认语言 + auto: false // 是否根据用户电脑配置自动设置语言(仅第一次有效) }, - /** - * 布局配置 - * */ - layout: {}, + layout: {}, // 布局配置 /** * 功能配置 * */ - // 相同路由,不同参数间进行切换,是否强力更新 - sameRouteForceUpdate: false, - // 是否使用动态路由 - dynamicRoute: false + sameRouteForceUpdate: false, // 相同路由,不同参数间进行切换,是否强力更新 + dynamicRoute: false // 是否使用动态路由 }; export default Setting;