Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly
Conflicts: src/utils/baseUrl.js
This commit is contained in:
commit
a51d2348a4
19
src/App.vue
19
src/App.vue
@ -2,6 +2,8 @@
|
||||
<div id="app">
|
||||
<router-view />
|
||||
<deomon-topic ref="deomonTopic" />
|
||||
<deomon-list ref="deomonList" @enterQcode="qcodeEntry" />
|
||||
<qcode ref="qcode" />
|
||||
<img v-show="loading" :src="loadingImg" class="AppAll">
|
||||
<div
|
||||
v-if="!$store.state.user.baseUrl"
|
||||
@ -25,11 +27,15 @@ import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import LoadingImg from '@/assets/loading.gif';
|
||||
import AppLoading from '@/assets/appLoading.png';
|
||||
import { openIndexedDB } from '@/utils/indexedDb';
|
||||
import DeomonList from '@/views/demonstration/deomonList/index';
|
||||
import Qcode from '@/layout/components/Qcode.vue';
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
DeomonTopic
|
||||
DeomonTopic,
|
||||
DeomonList,
|
||||
Qcode
|
||||
},
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
@ -67,6 +73,11 @@ export default {
|
||||
},
|
||||
'$store.state.app.animationsCloseCount': function(val) {
|
||||
this.loading = false;
|
||||
},
|
||||
'$route': function(val) {
|
||||
if (val.path == '/trainingPlatform/multiplayerSimulation') {
|
||||
this.quickEntry();
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -100,6 +111,12 @@ export default {
|
||||
this.$store.dispatch('subscribe_un', {});
|
||||
},
|
||||
methods: {
|
||||
quickEntry() {
|
||||
this.$refs.deomonList.doShow();
|
||||
},
|
||||
qcodeEntry() {
|
||||
this.$refs.qcode.doShow();
|
||||
},
|
||||
resizeHandler() {
|
||||
this.$store.dispatch('app/resize', { width: this._clientWidth, height: this._clientHeight });
|
||||
},
|
||||
|
@ -93,3 +93,23 @@ export function getLoginInfo(token) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户所属组织列表
|
||||
*/
|
||||
export function getOrgList() {
|
||||
return request({
|
||||
url: '/api/org/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 登入组织
|
||||
*/
|
||||
export function selectOrgnization(orgId) {
|
||||
return request({
|
||||
url: `/api/org/signIn/${orgId}`,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
@ -143,3 +143,11 @@ export function checkFrontProjectExist(params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
//
|
||||
export function getUploadUrl(params) {
|
||||
return request({
|
||||
url: `/api/minio/preSignedUrl`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import systemGenerate from './systemGenerate';
|
||||
import login from './login';
|
||||
import designPlatform from './designPlatform';
|
||||
import trainingManage from './trainingManage';
|
||||
import newRouter from './newRouter';
|
||||
|
||||
export default {
|
||||
enLocale,
|
||||
@ -61,5 +62,6 @@ export default {
|
||||
systemGenerate,
|
||||
login,
|
||||
designPlatform,
|
||||
trainingManage
|
||||
trainingManage,
|
||||
newRouter
|
||||
};
|
||||
|
44
src/i18n/langs/en/newRouter.js
Normal file
44
src/i18n/langs/en/newRouter.js
Normal file
@ -0,0 +1,44 @@
|
||||
export default {
|
||||
simulation: 'simulation',
|
||||
multiplayerSimulation: 'Many simulation',
|
||||
regulationSimulation: 'Regulation of the simulation',
|
||||
teachingManagement: 'teaching management',
|
||||
classroom: 'classroom management',
|
||||
student: 'student management',
|
||||
theory: 'The theory of management',
|
||||
training: 'Practical teaching management',
|
||||
exam: 'examination management',
|
||||
lineDesign: 'track design',
|
||||
case: 'case',
|
||||
SystemManagement: 'System management',
|
||||
SystemDataManagement: 'System data management',
|
||||
dataDictionary: 'Data dictionary',
|
||||
SystemAccountManagement: 'System Account Management',
|
||||
ThirdPartyAccounts: 'Configuring Third-Party Accounts',
|
||||
OnlineInformationManagement: 'Online information management',
|
||||
loginUser: 'Online users',
|
||||
cacheDataManage: 'Cache data management',
|
||||
simulationManage: 'simulation management',
|
||||
companyUserManage: 'Organization User Management',
|
||||
companyManage: 'Company manage',
|
||||
lineDataManage: 'Line data management',
|
||||
lineTypeManage: 'Line type management',
|
||||
linePacketManage: 'Line packet management',
|
||||
teachingDataManage: 'Teaching data management',
|
||||
theoryData: 'Theoretical topic data management',
|
||||
trainingDataManage: 'Training data management',
|
||||
examData: 'Examination data management',
|
||||
userTrainingDataManage: 'User training data management',
|
||||
userExamData: 'User test data management',
|
||||
projectDataManage: 'Project data management',
|
||||
projectManage: 'Project Manage',
|
||||
projectConfig: 'Project client configuration',
|
||||
projectDeviceManage: 'Project equipment management',
|
||||
permissionDataManage: 'Permission Data Management',
|
||||
permissionManage: 'Permission',
|
||||
authorityTransferManage: 'Privilege distribution management',
|
||||
userRulesManage: 'User Rights Statistics',
|
||||
fileManage: 'File Manage',
|
||||
frontResourceManage: 'Front-end Resource Management',
|
||||
iscsPrerecordManage: 'ISCS Advance record management'
|
||||
};
|
@ -29,6 +29,7 @@ import systemGenerate from './systemGenerate';
|
||||
import login from './login';
|
||||
import designPlatform from './designPlatform';
|
||||
import trainingManage from './trainingManage';
|
||||
import newRouter from './newRouter';
|
||||
|
||||
export default {
|
||||
cnLocale,
|
||||
@ -61,5 +62,6 @@ export default {
|
||||
systemGenerate,
|
||||
login,
|
||||
designPlatform,
|
||||
trainingManage
|
||||
trainingManage,
|
||||
newRouter
|
||||
};
|
||||
|
44
src/i18n/langs/zh/newRouter.js
Normal file
44
src/i18n/langs/zh/newRouter.js
Normal file
@ -0,0 +1,44 @@
|
||||
export default {
|
||||
simulation: '仿真',
|
||||
multiplayerSimulation: '多人仿真',
|
||||
regulationSimulation: '监管仿真',
|
||||
teachingManagement: '教学管理',
|
||||
classroom: '班级管理',
|
||||
student: '学生管理',
|
||||
theory: '理论题目管理',
|
||||
training: '实训教学管理',
|
||||
exam: '考试管理',
|
||||
lineDesign: '线路设计',
|
||||
case: '案例管理',
|
||||
SystemManagement: '系统管理',
|
||||
SystemDataManagement: '系统数据管理',
|
||||
dataDictionary: '数据字典',
|
||||
SystemAccountManagement: '系统账户管理',
|
||||
ThirdPartyAccounts: '第三方账户配置',
|
||||
OnlineInformationManagement: '在线信息管理',
|
||||
loginUser: '在线用户',
|
||||
cacheDataManage: '缓存数据管理',
|
||||
simulationManage: '仿真管理',
|
||||
companyUserManage: '组织用户管理',
|
||||
companyManage: '组织管理',
|
||||
lineDataManage: '线路数据管理',
|
||||
lineTypeManage: '线路类型管理',
|
||||
linePacketManage: '线路分组管理',
|
||||
teachingDataManage: '教学数据管理',
|
||||
theoryData: '理论题数据管理',
|
||||
trainingDataManage: '实训数据管理',
|
||||
examData: '考试数据管理',
|
||||
userTrainingDataManage: '用户实训数据管理',
|
||||
userExamData: '用户考试数据管理',
|
||||
projectDataManage: '项目数据管理',
|
||||
projectManage: '项目管理',
|
||||
projectConfig: '项目客户端配置',
|
||||
projectDeviceManage: '项目设备管理',
|
||||
permissionDataManage: '权限数据管理',
|
||||
permissionManage: '权限管理',
|
||||
authorityTransferManage: '权限分发管理',
|
||||
userRulesManage: '用户权限管理',
|
||||
fileManage: '文件管理',
|
||||
frontResourceManage: '前端资源管理',
|
||||
iscsPrerecordManage: 'ISCS预录管理'
|
||||
};
|
@ -11,6 +11,7 @@
|
||||
@select="handleSelect"
|
||||
>
|
||||
<system-title />
|
||||
<div class="centerNullMenu" />
|
||||
<template v-for="(item, idx) in routers">
|
||||
<template v-if="!item.hidden&&item.children">
|
||||
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
|
||||
@ -41,13 +42,13 @@
|
||||
<template v-for="(child,cdx) in item.children">
|
||||
<template v-if="!child.hidden">
|
||||
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
|
||||
<el-submenu :key="cdx" :index="child.path" :show-timeout="100">
|
||||
<el-submenu :key="cdx" :index="child.path" :show-timeout="100" popper-class="grandChildClass">
|
||||
<template slot="title">
|
||||
<span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
|
||||
</template>
|
||||
<template v-for="(grandchild,gdx) in child.children">
|
||||
<template v-if="!grandchild.hidden">
|
||||
<template :to="child.path+'/'+grandchild.path">
|
||||
<template v-if="!grandchild.children" :to="child.path+'/'+grandchild.path">
|
||||
<el-menu-item :key="gdx" :index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)">
|
||||
<span
|
||||
v-if="grandchild.meta"
|
||||
@ -55,11 +56,25 @@
|
||||
>{{ $t(grandchild.meta.i18n) }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
<template v-else :to="child.path+'/'+grandchild.path">
|
||||
<el-submenu v-for="(mgChild,mgdx) in grandchild.children" :key="mgdx" :index="mgChild.path" :show-timeout="100">
|
||||
<template slot="title">
|
||||
<span v-if="mgChild.meta" slot="title">{{ $t(mgChild.meta.i18n) }}</span>
|
||||
</template>
|
||||
<el-menu-item :key="mgdx" :index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path + '/' + mgChild.path)">
|
||||
<span
|
||||
v-if="mgChild.meta"
|
||||
slot="title"
|
||||
>{{ $t(mgChild.meta.i18n) }}</span>
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</el-submenu>
|
||||
</template>
|
||||
<template v-else :to="item.path+'/'+child.path">
|
||||
<!-- <el-menu-item :key="cdx" :index="item.redirect ? item.redirect : (item.path+'/'+child.path)" :route="(child.route && child.route()) ? child.route() : null"> -->
|
||||
<el-menu-item :key="cdx" :index="item.redirect ? item.redirect : (item.path+'/'+child.path)">
|
||||
<span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
|
||||
</el-menu-item>
|
||||
@ -70,7 +85,7 @@
|
||||
</template>
|
||||
</template>
|
||||
<div v-if="!thirdLogin" class="rightGroup">
|
||||
<quick-entry ref="quickEntry" />
|
||||
<!-- <quick-entry ref="quickEntry" /> -->
|
||||
<user-logout ref="userLogout" />
|
||||
</div>
|
||||
</el-menu>
|
||||
@ -171,9 +186,10 @@ export default {
|
||||
$height: 61px;
|
||||
|
||||
.rightGroup{
|
||||
position: absolute;
|
||||
right: 35px;
|
||||
// position: absolute;
|
||||
// right: 35px;
|
||||
display: inline-block;
|
||||
padding: 0 35px;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
@ -181,7 +197,11 @@ export default {
|
||||
line-height: $height;
|
||||
padding-left: 30px;
|
||||
border-radius: 0px !important;
|
||||
|
||||
display: flex;
|
||||
.centerNullMenu {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
.image-container {
|
||||
line-height: $height;
|
||||
height: $height;
|
||||
@ -214,4 +234,7 @@ export default {
|
||||
margin-right:20px;
|
||||
font-size:14px;
|
||||
}
|
||||
/deep/ .grandChildClass {
|
||||
left: -210px !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,34 +1,36 @@
|
||||
import Vue from 'vue';
|
||||
import store from '@/store/index';
|
||||
import router from './router/index';
|
||||
import {loginInfo, ProjectCode, localPackageProject} from '@/scripts/ProjectConfig';
|
||||
// import {loginInfo, ProjectCode, localPackageProject} from '@/scripts/ProjectConfig';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
import { setToken, getToken, removeToken, getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import { getBaseUrlByProject } from '@/api/projectServer';
|
||||
// import { getBaseUrlByProject } from '@/api/projectServer';
|
||||
import localStore from 'storejs';
|
||||
import { handlerUrl } from '@/utils/baseUrl';
|
||||
import { getFrontProjectConfigByLogin} from '@/api/projectConfig';
|
||||
|
||||
const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
|
||||
const whiteList = ['/login', '/design/login', '/loginNew', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
|
||||
|
||||
const loginList = ['/login', '/design/login']; // 登陆页面
|
||||
const loginList = ['/login', '/design/login', '/loginNew']; // 登陆页面
|
||||
|
||||
for (const val in loginInfo) {
|
||||
if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) {
|
||||
whiteList.push(loginInfo[val].loginPath);
|
||||
}
|
||||
}
|
||||
// for (const val in loginInfo) {
|
||||
// if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) {
|
||||
// whiteList.push(loginInfo[val].loginPath);
|
||||
// }
|
||||
// }
|
||||
|
||||
// 登录路径判断获取
|
||||
function getRouteInfo(to) {
|
||||
function getRouteInfo(to, markKey) {
|
||||
let loginPath = '';
|
||||
const toRoutePath = to.redirectedFrom || to.path;
|
||||
const current_session = getSessionStorage('project');
|
||||
// const current_session = getSessionStorage('project');
|
||||
if (loginList.includes(toRoutePath)) { // 登陆页面清空 token
|
||||
removeToken();
|
||||
}
|
||||
const localLogin = process.env.VUE_APP_PRO == 'local' || process.env.VUE_APP_PRO == 'ntyl';
|
||||
loginPath = loginInfo[current_session] && !localLogin ? loginInfo[current_session].loginPath : whiteList[0];
|
||||
// const localLogin = process.env.VUE_APP_PRO == 'local' || process.env.VUE_APP_PRO == 'ntyl';
|
||||
// loginPath = loginInfo[current_session] && !localLogin ? loginInfo[current_session].loginPath : whiteList[0];
|
||||
loginPath = markKey == 'login' ? '/login' : '/login?project=' + markKey;
|
||||
if (to.query.projectDevice && to.query.type && loginPath.includes('?')) {
|
||||
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`;
|
||||
} else if (to.query.projectDevice && to.query.type) {
|
||||
@ -76,71 +78,78 @@ function subscribe() {
|
||||
}
|
||||
}
|
||||
router.beforeEach( async (to, from, next) => {
|
||||
// 判断第三方登陆
|
||||
if (to.query.thirdJump) {
|
||||
setToken(to.query.key);
|
||||
setSessionStorage('project', to.query.project);
|
||||
}
|
||||
let project = '';
|
||||
let project;
|
||||
// 登陆页面
|
||||
if (to.path.includes('login')) {
|
||||
project = to.query.project;
|
||||
const split = to.path.split('/')[1];
|
||||
if (process.env.VUE_APP_PRO && process.env.VUE_APP_PRO !== 'local-test') {
|
||||
project = localPackageProject[process.env.VUE_APP_PRO + split];
|
||||
} else if (split == 'design') {
|
||||
project = project ? split + project : split;
|
||||
} else if (split == 'login') {
|
||||
project = project || 'login';
|
||||
} else {
|
||||
project = split;
|
||||
}
|
||||
project = to.query.project || 'login';
|
||||
} else if (to.path.includes('thirdLogin')) {
|
||||
// 第三方登陆页面
|
||||
project = to.query.project;
|
||||
} else {
|
||||
project = getSessionStorage('project');
|
||||
// 登陆成功页面
|
||||
project = getSessionStorage('project') || 'login';
|
||||
}
|
||||
if (!store.state.user.baseUrl && project && loginInfo[project]) {
|
||||
try {
|
||||
const resp = await getBaseUrlByProject(ProjectCode[project]);
|
||||
const urlData = handlerUrl(resp.data);
|
||||
store.dispatch('setBaseUrl', urlData.BASE_API);
|
||||
store.dispatch('setResourcesUrl', urlData.VOICE_API);
|
||||
store.dispatch('setUploadUrl', urlData.UPLOAD_API);
|
||||
store.dispatch('setBaseSite', urlData.BASE_SITE);
|
||||
subscribe();
|
||||
} catch (e) {
|
||||
// if (to.path.includes('login')) {
|
||||
// project = to.query.project;
|
||||
// const split = to.path.split('/')[1];
|
||||
// if (process.env.VUE_APP_PRO && process.env.VUE_APP_PRO !== 'local-test') {
|
||||
// project = localPackageProject[process.env.VUE_APP_PRO + split];
|
||||
// } else if (split == 'design') {
|
||||
// project = project ? split + project : split;
|
||||
// } else if (split == 'login') {
|
||||
// project = project || 'login';
|
||||
// } else {
|
||||
// project = split;
|
||||
// }
|
||||
// } else if (to.path.includes('thirdLogin')) {
|
||||
// project = to.query.project;
|
||||
// } else {
|
||||
// project = getSessionStorage('project');
|
||||
// }
|
||||
const response = await getFrontProjectConfigByLogin(project);
|
||||
if (response.data) {
|
||||
const {browserTitle, loginProLogo, baseApiUrl, baseSite, ossUrl} = response.data.viewSetting;
|
||||
if (!store.state.user.baseUrl && project) {
|
||||
const urlData = handlerUrl();
|
||||
store.dispatch('setBaseUrl', urlData.BASE_API);
|
||||
console.error(e);
|
||||
store.dispatch('setBaseUrl', baseApiUrl || urlData.BASE_API);
|
||||
store.dispatch('setBaseSite', baseSite || urlData.BASE_SITE);
|
||||
store.dispatch('setOssUrl', ossUrl || urlData.OSS_URL);
|
||||
subscribe();
|
||||
}
|
||||
}
|
||||
document.title = loginInfo[project || 'login'] ? loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title : '';
|
||||
NProgress.start();
|
||||
const loginPath = getRouteInfo(to);
|
||||
const token = to.query.token;
|
||||
|
||||
if (/demoTraining/.test(to.path) && token) {
|
||||
const header = { group: to.query.group, 'X-Token': token };
|
||||
setToken(token);
|
||||
store.commit('SET_TOKEN', token);
|
||||
store.commit('SUBSCRIBE', { header, type: '' });
|
||||
next();
|
||||
} else if (getToken()) {
|
||||
if (to.path === loginPath) {
|
||||
// 登录页面不拦截
|
||||
document.title = browserTitle;
|
||||
document.querySelector("link[rel*='icon']").href = loginProLogo ? '/oss-rtss/logo/' + loginProLogo : '';
|
||||
NProgress.start();
|
||||
const loginPath = getRouteInfo(to, response.data.markKey);
|
||||
const token = to.query.token;
|
||||
if (/demoTraining/.test(to.path) && token) {
|
||||
const header = { group: to.query.group, 'X-Token': token };
|
||||
setToken(token);
|
||||
store.commit('SET_TOKEN', token);
|
||||
store.commit('SUBSCRIBE', { header, type: '' });
|
||||
next();
|
||||
} else if (getToken()) {
|
||||
if (to.path === loginPath) {
|
||||
// 登录页面不拦截
|
||||
next();
|
||||
} else {
|
||||
// 进入系统重新计算路由
|
||||
handleRoute(to, next, loginPath);
|
||||
}
|
||||
} else {
|
||||
// 进入系统重新计算路由
|
||||
handleRoute(to, next, loginPath);
|
||||
}
|
||||
} else {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 在免登录白名单,直接进入
|
||||
next();
|
||||
} else if (to.path.substr(0, 13) == whiteList[2]) {
|
||||
next();
|
||||
} else {
|
||||
// 否则全部重定向到登录页
|
||||
next(loginPath);
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 在免登录白名单,直接进入
|
||||
next();
|
||||
} else if (to.path.substr(0, 13) == whiteList[2]) {
|
||||
next();
|
||||
} else {
|
||||
// 否则全部重定向到登录页
|
||||
next(loginPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -7,6 +7,8 @@ Vue.use(Router);
|
||||
/* Layout */
|
||||
const Layout = () => import('@/layout');
|
||||
const Login = () => import('@/views/login/index');
|
||||
const LoginNew = () => import('@/views/login_new/index');
|
||||
|
||||
const Authorization = () => import('@/views/authorization/index');
|
||||
const AuthorApply = () => import('@/views/authorization/apply');
|
||||
const AuthorList = () => import('@/views/authorization/list');
|
||||
@ -214,7 +216,10 @@ const FrontProjectConfigManage = () => import('@/views/system/frontProjectConfig
|
||||
const IscsDeviceManage = () => import('@/views/system/iscsDeviceManage');
|
||||
const IscsResourcesManage = () => import('@/views/system/iscsResourcesManage');
|
||||
|
||||
const PisScreen = () => import('@/views/pis/index')
|
||||
const PisScreen = () => import('@/views/pis/index');
|
||||
const Case = () => import('@/views/case/index');
|
||||
const TransitionIndex = () => import('@/views/temporary/transitionIndex');
|
||||
const Temporary = () => import('@/views/temporary/index');
|
||||
|
||||
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
|
||||
// import { getSessionStorage } from '@/utils/auth';
|
||||
@ -288,6 +293,12 @@ export const constantRoutes = [
|
||||
component: Login,
|
||||
hidden: true
|
||||
},
|
||||
// 新版平台登录页面
|
||||
{
|
||||
path: '/loginNew',
|
||||
component: LoginNew,
|
||||
hidden: true
|
||||
},
|
||||
// 设计平台登录
|
||||
{
|
||||
path: '/design',
|
||||
@ -1531,6 +1542,214 @@ export const asyncRouter = [
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{ // 新路由-仿真菜单
|
||||
path: '/trainingPlatform',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'newRouter.simulation',
|
||||
roles: [admin, user, userTrainingPlatform]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: TrainingPlatform,
|
||||
// route: { path: '/simulation/trainingPlatform/detail' },
|
||||
meta: {
|
||||
i18n: 'newRouter.simulation'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'detail/:subSystem',
|
||||
component: DemonstrationDetail,
|
||||
meta: {},
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'multiplayerSimulation',
|
||||
// component: multiplayerSimulation,
|
||||
meta: {
|
||||
i18n: 'newRouter.multiplayerSimulation'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'regulationSimulation',
|
||||
component: Temporary,
|
||||
meta: {
|
||||
i18n: 'newRouter.regulationSimulation'
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{ // 新路由-教学管理菜单
|
||||
path: '/teachingManagement',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'newRouter.teachingManagement',
|
||||
roles: [admin, user, userTrainingPlatform]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'classroom',
|
||||
// component: Classroom,
|
||||
meta: {
|
||||
i18n: 'newRouter.classroom'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'student',
|
||||
// component: Student,
|
||||
meta: {
|
||||
i18n: 'newRouter.student'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'theory',
|
||||
// component: Theory,
|
||||
meta: {
|
||||
i18n: 'newRouter.theory'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'training',
|
||||
// component: Training,
|
||||
meta: {
|
||||
i18n: 'newRouter.training'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'exam',
|
||||
// component: Exam,
|
||||
meta: {
|
||||
i18n: 'newRouter.exam'
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{ // 新路由-线路设计
|
||||
path: '/design',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'newRouter.lineDesign',
|
||||
roles: [admin, user, userTrainingPlatform]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'usermap',
|
||||
redirect: '/design/usermap/home',
|
||||
component: NewDesignPlatformUser,
|
||||
meta: {
|
||||
i18n: 'newRouter.lineDesign'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: DesignPlatformHome,
|
||||
hidden: true,
|
||||
meta: {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{ // 新路由-案例
|
||||
path: '/case',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'newRouter.case',
|
||||
roles: [admin, user, userTrainingPlatform]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: Case,
|
||||
meta: {
|
||||
i18n: 'newRouter.case'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{ // 新路由-系统管理
|
||||
path: '/system',
|
||||
component: Layout,
|
||||
meta: {
|
||||
i18n: 'newRouter.SystemManagement',
|
||||
roles: [admin, userTrainingPlatform]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/systemDataManagement',
|
||||
component: TransitionIndex,
|
||||
meta: {
|
||||
i18n: 'newRouter.SystemDataManagement'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'dictionary',
|
||||
component: Dictionary,
|
||||
meta: {
|
||||
i18n: 'newRouter.dataDictionary'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'userManage',
|
||||
component: UserControl,
|
||||
meta: {
|
||||
i18n: 'newRouter.SystemAccountManagement'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'ThirdPartyAccounts',
|
||||
component: Temporary,
|
||||
meta: {
|
||||
i18n: 'newRouter.ThirdPartyAccounts'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/OnlineInformationManagement',
|
||||
component: TransitionIndex,
|
||||
meta: {
|
||||
i18n: 'newRouter.OnlineInformationManagement'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'loginUserManage',
|
||||
component: LoginUserControl,
|
||||
meta: {
|
||||
i18n: 'newRouter.loginUser'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'CacheControl',
|
||||
component: CacheControl,
|
||||
meta: {
|
||||
i18n: 'newRouter.cacheDataManage'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'existingSimulation',
|
||||
component: ExistingSimulation,
|
||||
meta: {
|
||||
i18n: 'newRouter.simulationManage'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'companyUserManage',
|
||||
component: DeviceManage,
|
||||
meta: {
|
||||
i18n: 'newRouter.companyUserManage'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
/* merge 是否再路由处理中与asyncRouter进行合并 mergeIndex合并进入asyncRouter【mergeIndex】 慎重调整asyncRouter顺序 */
|
||||
|
@ -23,8 +23,9 @@ const user = {
|
||||
companyName: '',
|
||||
companyProjectList: [],
|
||||
baseUrl:'',
|
||||
resourcesUrl: '',
|
||||
uploadUrl: '',
|
||||
// resourcesUrl: '',
|
||||
// uploadUrl: '',
|
||||
ossUrl:'',
|
||||
baseSite: ''
|
||||
},
|
||||
|
||||
@ -86,11 +87,14 @@ const user = {
|
||||
setBaseUrl: (state, baseUrl) => {
|
||||
state.baseUrl = baseUrl;
|
||||
},
|
||||
setResourcesUrl: (state, resourcesUrl) => {
|
||||
state.resourcesUrl = resourcesUrl;
|
||||
},
|
||||
setUploadUrl: (state, uploadUrl) => {
|
||||
state.uploadUrl = uploadUrl;
|
||||
// setResourcesUrl: (state, resourcesUrl) => {
|
||||
// state.resourcesUrl = resourcesUrl;
|
||||
// },
|
||||
// setUploadUrl: (state, uploadUrl) => {
|
||||
// state.uploadUrl = uploadUrl;
|
||||
// },
|
||||
setOssUrl: (state, ossUrl) => {
|
||||
state.ossUrl = ossUrl;
|
||||
},
|
||||
setBaseSite: (state, baseSite) => {
|
||||
state.baseSite = baseSite;
|
||||
@ -226,11 +230,14 @@ const user = {
|
||||
setBaseUrl ({commit}, baseUrl) {
|
||||
commit('setBaseUrl', baseUrl);
|
||||
},
|
||||
setResourcesUrl({commit}, resourcesUrl) {
|
||||
commit('setResourcesUrl', resourcesUrl);
|
||||
},
|
||||
setUploadUrl({commit}, uploadUrl) {
|
||||
commit('setUploadUrl', uploadUrl);
|
||||
// setResourcesUrl({commit}, resourcesUrl) {
|
||||
// commit('setResourcesUrl', resourcesUrl);
|
||||
// },
|
||||
// setUploadUrl({commit}, uploadUrl) {
|
||||
// commit('setUploadUrl', uploadUrl);
|
||||
// },
|
||||
setOssUrl({commit}, ossUrl) {
|
||||
commit('setOssUrl', ossUrl);
|
||||
},
|
||||
setBaseSite({commit}, baseSite) {
|
||||
commit('setBaseSite', baseSite);
|
||||
|
@ -16,56 +16,102 @@
|
||||
// }
|
||||
// return BASE_API;
|
||||
// }
|
||||
export function handlerUrl(data) {
|
||||
|
||||
export function handlerUrl() {
|
||||
let BASE_API;
|
||||
let VOICE_API;
|
||||
let UPLOAD_API;
|
||||
let BASE_SITE;
|
||||
let OSS_URL;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// const data = null;
|
||||
// 开发分支
|
||||
BASE_API = 'http://192.168.3.233/rtss-server';
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.233/rtss-server';
|
||||
// BASE_API = 'http://114.116.51.125/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.90:9100'; // 周寅
|
||||
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
|
||||
BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
|
||||
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||
// BASE_API = data && data.domainName ? 'https://' + data.domainName : BASE_API;
|
||||
BASE_API = data && data.domainName ? 'http://' + data.domainName : BASE_API;
|
||||
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||
UPLOAD_API = 'http://joylink.club/jlfile';
|
||||
BASE_SITE = 'https://test.joylink.club/cbtc';
|
||||
OSS_URL = 'https://192.168.3.233/oss-rtss';
|
||||
} else if (process.env.NODE_ENV === 'test' && process.env.VUE_APP_PRO === 'local-test') {
|
||||
BASE_API = 'https://192.168.3.233/rtss-server';
|
||||
VOICE_API = 'https://192.168.3.233/oss/joylink';
|
||||
UPLOAD_API = 'https://192.168.3.233';
|
||||
BASE_SITE = '/cbtc';
|
||||
// 本地打包测试分支
|
||||
BASE_API = 'https://192.168.3.233/rtss-server'; // api地址
|
||||
BASE_SITE = 'https://192.168.3.233/cbtc'; // 前端项目地址
|
||||
OSS_URL = 'https://192.168.3.233/oss-rtss'; // 资源地址
|
||||
} else if (process.env.NODE_ENV === 'test') {
|
||||
BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://test.joylink.club/jlcloud';
|
||||
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||
UPLOAD_API = 'http://joylink.club/jlfile';
|
||||
// 测试分支
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_SITE = 'https://test.joylink.club/cbtc';
|
||||
OSS_URL = 'https://joylink.club/oss-rtss'; // 资源地址
|
||||
} else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'local') {
|
||||
// 本地打包分支
|
||||
BASE_API = 'http://160.20.60.15:9000';
|
||||
VOICE_API = 'http://160.20.60.15/oss/joylink';
|
||||
UPLOAD_API = 'http://160.20.60.15';
|
||||
BASE_SITE = 'http://160.20.60.15';
|
||||
} else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'ntyl') {
|
||||
BASE_API = 'https://joylink.club/jlcloud';
|
||||
VOICE_API = 'https://joylink.club/oss/joylink';
|
||||
UPLOAD_API = 'http://joylink.club/jlfile';
|
||||
BASE_SITE = 'https://joylink.club/cbtc';
|
||||
OSS_URL = 'https://joylink.club/oss-rtss';
|
||||
} else if (process.env.NODE_ENV === 'production') {
|
||||
BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://joylink.club/jlcloud';
|
||||
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||
UPLOAD_API = 'http://joylink.club/jlfile';
|
||||
// 远程发布分支
|
||||
BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_SITE = 'https://joylink.club/cbtc';
|
||||
OSS_URL = 'https://joylink.club/oss-rtss';
|
||||
}
|
||||
const PROD_API = 'https://joylink.club/jlcloud';
|
||||
return {BASE_API, VOICE_API, UPLOAD_API, BASE_SITE, PROD_API};
|
||||
// VOICE_API, UPLOAD_API, BASE_SITE, PROD_API
|
||||
return {BASE_API, BASE_SITE, OSS_URL};
|
||||
}
|
||||
|
||||
// export function handlerUrl(data) {
|
||||
// let BASE_API;
|
||||
// let VOICE_API;
|
||||
// let UPLOAD_API;
|
||||
// let BASE_SITE;
|
||||
// if (process.env.NODE_ENV === 'development') {
|
||||
// // const data = null;
|
||||
// // BASE_API = 'https://joylink.club/jlcloud';
|
||||
// // BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.233/rtss-server';
|
||||
// // BASE_API = 'http://114.116.51.125/jlcloud';
|
||||
// // BASE_API = 'http://192.168.3.90:9100'; // 周寅
|
||||
// // BASE_API = 'http://192.168.3.94:9000'; // 旭强
|
||||
// // BASE_API = 'http://192.168.3.15:9000'; // 张赛
|
||||
// // BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
|
||||
// // BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
|
||||
// // BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
// // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
|
||||
// // BASE_API = data && data.domainName ? 'https://' + data.domainName : BASE_API;
|
||||
// BASE_API = data && data.domainName ? 'http://' + data.domainName : BASE_API;
|
||||
// VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||
// // UPLOAD_API = 'http://joylink.club/jlfile';
|
||||
// BASE_SITE = 'https://test.joylink.club/cbtc';
|
||||
// } else if (process.env.NODE_ENV === 'test' && process.env.VUE_APP_PRO === 'local-test') {
|
||||
// BASE_API = 'https://192.168.3.233/rtss-server';
|
||||
// VOICE_API = 'https://192.168.3.233/oss/joylink';
|
||||
// UPLOAD_API = 'https://192.168.3.233';
|
||||
// BASE_SITE = '/cbtc';
|
||||
// } else if (process.env.NODE_ENV === 'test') {
|
||||
// BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://test.joylink.club/jlcloud';
|
||||
// VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||
// UPLOAD_API = 'http://joylink.club/jlfile';
|
||||
// BASE_SITE = 'https://test.joylink.club/cbtc';
|
||||
// } else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'local') {
|
||||
// BASE_API = 'http://160.20.60.15:9000';
|
||||
// VOICE_API = 'http://160.20.60.15/oss/joylink';
|
||||
// UPLOAD_API = 'http://160.20.60.15';
|
||||
// BASE_SITE = 'http://160.20.60.15';
|
||||
// } else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'ntyl') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// VOICE_API = 'https://joylink.club/oss/joylink';
|
||||
// UPLOAD_API = 'http://joylink.club/jlfile';
|
||||
// BASE_SITE = 'https://joylink.club/cbtc';
|
||||
// } else if (process.env.NODE_ENV === 'production') {
|
||||
// BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://joylink.club/jlcloud';
|
||||
// VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
|
||||
// UPLOAD_API = 'http://joylink.club/jlfile';
|
||||
// BASE_SITE = 'https://joylink.club/cbtc';
|
||||
// }
|
||||
// const PROD_API = 'https://joylink.club/jlcloud';
|
||||
// return {BASE_API, VOICE_API, UPLOAD_API, BASE_SITE, PROD_API};
|
||||
// }
|
||||
|
@ -28,13 +28,16 @@ service.interceptors.request.use(config => {
|
||||
// 用于/demo/index 文件中baseUrl 判断(后端要求不管本地还是正式,都要可以访问实训/临时使用)
|
||||
if (store.state.user.baseUrl) {
|
||||
config.baseURL = store.state.user.baseUrl;
|
||||
} else {
|
||||
config.baseURL = urlData.BASE_API;
|
||||
}
|
||||
if (config.upload) {
|
||||
config.baseURL = urlData.UPLOAD_API;
|
||||
}
|
||||
if (config.production) {
|
||||
config.baseURL = urlData.PROD_API;
|
||||
}
|
||||
// if (config.upload) {
|
||||
// config.baseURL = urlData.UPLOAD_API;
|
||||
// }
|
||||
// if (config.production) {
|
||||
// config.baseURL = urlData.PROD_API;
|
||||
// }
|
||||
|
||||
if (config.time) {
|
||||
config.timeout = config.time; // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
|
75
src/views/case/index.vue
Normal file
75
src/views/case/index.vue
Normal file
@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div class="quick-entry">
|
||||
<QueryListPage ref="queryListPage" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'Case',
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
caseList: [
|
||||
{
|
||||
name: '西安铁路职业技术学院',
|
||||
url: 'https://joylink.club/oss/portal/cases/西安铁路职业技术学院.pdf'
|
||||
},
|
||||
{
|
||||
name: '贵州装备制造职业学院',
|
||||
url: 'https://joylink.club/oss/portal/cases/贵州装备制造职业学院机电技术专业实训室建设.pdf'
|
||||
},
|
||||
{
|
||||
name: '江苏电子信息职业学院',
|
||||
url: 'https://joylink.club/oss/portal/cases/江苏电子信息职业学院-城市轨道交通行车组织综合实训室.pdf'
|
||||
}
|
||||
],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
show:false
|
||||
},
|
||||
queryList: {
|
||||
data: [],
|
||||
selectCheckShow: false,
|
||||
paginationHiden: true,
|
||||
indexShow: true,
|
||||
height: 500,
|
||||
columns: [
|
||||
{
|
||||
title: '案例名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
prop: 'description'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '150',
|
||||
buttons: [
|
||||
{
|
||||
name: '查看',
|
||||
handleClick: this.handleClick,
|
||||
type: 'primary'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.queryList.data = this.caseList;
|
||||
},
|
||||
methods: {
|
||||
handleClick(index, row) {
|
||||
window.open(row.url, '_blank');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
File diff suppressed because it is too large
Load Diff
174
src/views/login_new/index.vue
Normal file
174
src/views/login_new/index.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="syncLogin">
|
||||
{{}}
|
||||
</div>
|
||||
<div v-else class="login-container" :style="{ 'background-image': showBackPic?'url(' + bgImg + ')':'none' }">
|
||||
<div class="language_box">
|
||||
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
|
||||
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="left-logo-box">
|
||||
<img class="logo" :src="loginProLogo" :style="{ width: loginProLogoWidth,height:loginProLogoHeight }">
|
||||
<span>{{ loginOrgTitle }}</span>
|
||||
</div>
|
||||
<div class="text-box">{{ loginProtitle }}</div>
|
||||
<div class="content-box">
|
||||
<wechat-login ref="wechatLogin" :project="backProject" :sync-login="syncLogin" />
|
||||
<!-- :style="noQrcodeList.includes(project) ? 'width: 450px;' : ''" -->
|
||||
<!-- 微信登陆 -->
|
||||
<!-- v-if="wechatLogin" -->
|
||||
|
||||
<!-- 默认登陆 -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import bgImg from '@/assets/bg1.jpg';
|
||||
import LangStorage from '@/utils/lang';
|
||||
import { getFrontProjectConfigByLogin} from '@/api/projectConfig';
|
||||
import WechatLogin from './wechatLogin';
|
||||
export default {
|
||||
name:'LoginNew',
|
||||
components: { WechatLogin },
|
||||
data() {
|
||||
return {
|
||||
backProject:'',
|
||||
language: '中文',
|
||||
lang: 'zh',
|
||||
loginProtitle:'',
|
||||
showBackPic:true,
|
||||
wechatLogin:true,
|
||||
loginProLogoWidth:0,
|
||||
loginProLogoHeight:0,
|
||||
loginOrgTitle:'',
|
||||
loginProLogo:''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
project() {
|
||||
return this.$route.query.project || 'login';
|
||||
},
|
||||
syncLogin() {
|
||||
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX', 'ILW', 'PIS_STAND', 'PIS_TRAIN'];
|
||||
return this.$route.query.type ? synchronousLogin.includes(this.$route.query.type) : false;
|
||||
},
|
||||
bgImg() {
|
||||
return bgImg;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const nowLang = LangStorage.getLang('zh');
|
||||
if (nowLang === 'zh') {
|
||||
this.lang = 'en';
|
||||
this.language = 'English';
|
||||
}
|
||||
getFrontProjectConfigByLogin(this.project).then(response => {
|
||||
if (response.data) {
|
||||
this.backProject = response.data.project;
|
||||
const {showBackPic, wechatLogin, browserTitle, loginProtitle, loginProLogoWidth, loginProLogoHeight, loginOrgTitle, loginProLogo} = response.data.viewSetting;
|
||||
this.showBackPic = showBackPic;
|
||||
this.wechatLogin = wechatLogin;
|
||||
this.loginProtitle = loginProtitle;
|
||||
this.loginProLogoWidth = loginProLogoWidth;
|
||||
this.loginProLogoHeight = loginProLogoHeight;
|
||||
this.loginOrgTitle = loginOrgTitle;
|
||||
this.loginProLogo = loginProLogo ? this.$store.state.user.ossUrl + '/logo/' + loginProLogo : '';
|
||||
document.title = browserTitle;
|
||||
document.querySelector("link[rel*='icon']").href = this.loginProLogo;
|
||||
// document.querySelector("link[rel*='icon']").href = loginInfo[this.project].linkIcon || ProjectIcon[this.project]
|
||||
// aboutSystem:"主体:北京玖琏科技有限公司 备案号:京ICP备2021039716号"
|
||||
// baseDevelopment
|
||||
// :
|
||||
// false
|
||||
// caseShow
|
||||
// :
|
||||
// true
|
||||
// helpShow
|
||||
// :
|
||||
// true
|
||||
// homeTitle
|
||||
// :
|
||||
// "城市轨道交通平台"
|
||||
// loginContectInformation
|
||||
// :
|
||||
// false
|
||||
// loginOrgTitle
|
||||
// :
|
||||
// ""
|
||||
// loginProLogo
|
||||
// :
|
||||
// ""
|
||||
// loginProLogoHeight
|
||||
// :
|
||||
// ""
|
||||
// loginProLogoWidth
|
||||
// :
|
||||
// ""
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox('无效的登录路径,请查证路径后重试!');
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
handleLanguage() {
|
||||
this.$i18n.locale = this.lang;
|
||||
LangStorage.setLang(this.lang);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.login-container {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: #e4eaea;
|
||||
background-repeat: no-repeat;
|
||||
background-origin: border-box;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.language_box {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 40px;
|
||||
.language_btn {
|
||||
/*font-weight: bold;*/
|
||||
cursor: pointer;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
.text-box {
|
||||
font-size: 39px;
|
||||
font-weight: bold;
|
||||
top: 150px;
|
||||
width: 1070px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
}
|
||||
.content-box {
|
||||
// width: 740px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
padding: 30px 30px 30px;
|
||||
margin-bottom: 20px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
.left-logo-box {
|
||||
position: absolute;
|
||||
top: 2%;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
left: 2%;
|
||||
}
|
||||
|
||||
</style>
|
165
src/views/login_new/wechatLogin.vue
Normal file
165
src/views/login_new/wechatLogin.vue
Normal file
@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<div class="qrcode-main">
|
||||
<div class="login-code-box" @click="loginRefresh">
|
||||
<qrcode-vue
|
||||
v-loading="loadingCode"
|
||||
:value="loginUrl"
|
||||
:class-name="qrcodeClassName"
|
||||
:size="150"
|
||||
:element-loading-text="this.$t('login.clickRefresh')"
|
||||
element-loading-spinner="el-icon-refresh"
|
||||
element-loading-background="rgba(255, 255, 255, 0.9)"
|
||||
/>
|
||||
</div>
|
||||
<div class="login-tip">
|
||||
<span class="sub-title">{{ $t('login.scanCodeLogin') }}</span>
|
||||
</div>
|
||||
<div class="tip-info">
|
||||
<fieldset>
|
||||
<legend>
|
||||
{{ $t('login.recommendedConfiguration') }}
|
||||
</legend>
|
||||
<span>{{ $t('login.browser') }}
|
||||
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">{{
|
||||
$t('login.googleChrome')
|
||||
}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<span>{{ $t('login.screenResolution') + '1920*1080' }}</span>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// , gtLoginInfo, getOrgList, selectOrgnization
|
||||
import QrcodeVue from 'qrcode.vue';
|
||||
import { getLoginWmurl, checkLoginStatus} from '@/api/login';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
export default {
|
||||
name:'WeChatLogin',
|
||||
components: { QrcodeVue },
|
||||
props: {
|
||||
project: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
syncLogin:{
|
||||
type: Boolean,
|
||||
default: () => {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loadingCode: false,
|
||||
loginUrl: '',
|
||||
sessionId: '',
|
||||
checkLogin: null,
|
||||
qrcodeClassName: 'login-qrcode',
|
||||
modelType: 'class',
|
||||
loginClient:'LianKeTang'
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
loginRefresh() {
|
||||
// this.loadingCode = true;
|
||||
const self = this;
|
||||
const params = LoginParams[this.loginClient];
|
||||
params.project = this.project;
|
||||
if (this.$route.query.projectDevice) {
|
||||
params.deviceCode = this.$route.query.projectDevice;
|
||||
}
|
||||
getLoginWmurl(params)
|
||||
.then(response => {
|
||||
// debugger;
|
||||
this.sessionId = response.data.sessionId;
|
||||
this.loginUrl = response.data.url;
|
||||
this.loadingCode = false;
|
||||
// debugger;
|
||||
this.checkLoginStatus();
|
||||
})
|
||||
.catch(() => {
|
||||
if (this.syncLogin) {
|
||||
setTimeout(() => {
|
||||
self.loginRefresh();
|
||||
}, 3000);
|
||||
} else {
|
||||
this.loadingCode = false;
|
||||
this.$messageBox(this.$t('login.getLoginQrCode'));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
checkLoginStatus() {
|
||||
const self = this;
|
||||
// 销毁则不再定时
|
||||
if (this && this._isDestroyed) {
|
||||
return;
|
||||
}
|
||||
// 清空已存在的定时器
|
||||
// 设置定时器检测
|
||||
this.clearTimer(this.checkLogin);
|
||||
this.checkLogin = setTimeout(() => {
|
||||
checkLoginStatus(self.sessionId)
|
||||
.then(response => {
|
||||
// 设置扫码登录
|
||||
self.$store
|
||||
.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token, type: this.modelType })
|
||||
.then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
// this.handleLoginSucessRoute();
|
||||
this.checkOrgnizationInfo();
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
if ((error.data && error.data.status === 'EXPIRE') || error.code != 200) {
|
||||
if (this.syncLogin) {
|
||||
self.loginRefresh();
|
||||
} else {
|
||||
this.loadingCode = true;
|
||||
this.loginUrl = '';
|
||||
}
|
||||
} else {
|
||||
self.checkLoginStatus();
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
$qrbg: #fff;
|
||||
.qrcode-main {
|
||||
width:300px;
|
||||
background-color: $qrbg;
|
||||
text-align: center;
|
||||
border-right: 1px solid #ececec;
|
||||
.tip-info {
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
color: green;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.login-code-box {
|
||||
width: 150px;
|
||||
margin: 0 auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.system-type {
|
||||
margin: 5px 0;
|
||||
display: block;
|
||||
}
|
||||
.sub-title {
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: #353535;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -22,24 +22,43 @@
|
||||
<el-form-item label="关于系统:" prop="aboutSystem">
|
||||
<el-input v-model="formModel.aboutSystem" style="width: 400px;" size="small" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="项目Logo:" prop="loginProLogo">
|
||||
<div class="eachButton uploadLogo">
|
||||
<img v-if="formModel.loginProLogo" :src="computedLoginLogo" :alt="computedLoginLogo" class="loginLogo">
|
||||
<i class="el-icon-plus avatar-uploader-icon el-icon-other" />
|
||||
<input id="upload_file" ref="files" type="file" class="file_box" accept="image/jpeg,image/png" @change="uploadLogo">
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- loginProLogo:'', // 登录页 logo
|
||||
loginProLogoWidth:'', // 登录页 logo 宽度
|
||||
loginProLogoHeight:'', // 登录页 logo 高度 -->
|
||||
|
||||
<el-form-item label="页签名称:" prop="browserTitle" class="inlineBlock">
|
||||
<el-input v-model="formModel.browserTitle" style="width: 210px;" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="导航栏名称:" prop="homeTitle" class="inlineBlock" style="margin-left:10px">
|
||||
<el-input v-model="formModel.homeTitle" style="width: 210px;" size="small" />
|
||||
</el-form-item>
|
||||
<!-- navLogoWidth //导航栏Logo宽度 -->
|
||||
<!-- navLogoHeight //导航栏Logo高度 -->
|
||||
<el-form-item label="案例展示:" prop="caseShow" class="inlineBlock">
|
||||
<el-switch v-model="formModel.caseShow" />
|
||||
</el-form-item>
|
||||
<el-form-item label="帮助展示:" prop="helpShow" class="inlineBlock">
|
||||
<el-switch v-model="formModel.helpShow" />
|
||||
</el-form-item>
|
||||
|
||||
<br>
|
||||
<el-form-item label="登陆后跳转路径:" prop="judgeRoute" class="inlineBlock">
|
||||
<el-input v-model="formModel.judgeRoute" style="width: 210px;" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="接口地址:" prop="baseApiUrl" class="inlineBlock">
|
||||
<el-input v-model="formModel.baseApiUrl" style="width: 210px;" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前域名:" prop="baseSite" class="inlineBlock">
|
||||
<el-input v-model="formModel.baseSite" style="width: 210px;" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件地址:" prop="ossUrl" class="inlineBlock">
|
||||
<el-input v-model="formModel.ossUrl" style="width: 210px;" size="small" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
@ -48,7 +67,7 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { updateFrontProjectConfig } from '@/api/projectConfig';
|
||||
import { updateFrontProjectConfig, getUploadUrl } from '@/api/projectConfig';
|
||||
export default {
|
||||
name:'FrontProjectConfig',
|
||||
data() {
|
||||
@ -70,8 +89,15 @@ export default {
|
||||
|
||||
browserTitle:'', // 浏览器页签名称
|
||||
homeTitle:'', // 导航栏名称
|
||||
navLogoWidth:'', // 导航栏Logo宽度
|
||||
navLogoHeight:'', // 导航栏Logo高度
|
||||
caseShow:true, // 导航栏案例展示是否展示
|
||||
helpShow:true // 导航栏帮助展示是否展示
|
||||
helpShow:true, // 导航栏帮助展示是否展示
|
||||
|
||||
judgeRoute:'', // 跳转路径
|
||||
baseApiUrl:'', // api链接
|
||||
baseSite:'', // 当前域名
|
||||
ossUrl:'' // 文件oss地址
|
||||
|
||||
}
|
||||
};
|
||||
@ -91,6 +117,9 @@ export default {
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
computedLoginLogo() {
|
||||
return this.formModel.loginProLogo ? this.$store.state.user.ossUrl + '/logo/' + this.formModel.loginProLogo : '';
|
||||
},
|
||||
title() {
|
||||
return '修改前端配置';
|
||||
}
|
||||
@ -107,8 +136,8 @@ export default {
|
||||
this.formModel.loginOrgTitle = viewSetting.loginOrgTitle || '';
|
||||
this.formModel.baseDevelopment = viewSetting.baseDevelopment || false;
|
||||
this.formModel.aboutSystem = viewSetting.aboutSystem || '';
|
||||
this.formModel.showBackPic = viewSetting.showBackPic || true;
|
||||
this.formModel.wechatLogin = viewSetting.wechatLogin || true;
|
||||
this.formModel.showBackPic = viewSetting.showBackPic || false;
|
||||
this.formModel.wechatLogin = viewSetting.wechatLogin || false;
|
||||
this.formModel.loginContectInformation = viewSetting.loginContectInformation || false;
|
||||
|
||||
this.formModel.loginProLogo = viewSetting.loginProLogo || '';
|
||||
@ -117,9 +146,15 @@ export default {
|
||||
|
||||
this.formModel.browserTitle = viewSetting.browserTitle || '';
|
||||
this.formModel.homeTitle = viewSetting.homeTitle || '';
|
||||
this.formModel.caseShow = viewSetting.caseShow || true;
|
||||
this.formModel.helpShow = viewSetting.helpShow || true;
|
||||
this.formModel.navLogoWidth = viewSetting.navLogoWidth || '';
|
||||
this.formModel.navLogoHeight = viewSetting.navLogoHeight || '';
|
||||
this.formModel.caseShow = viewSetting.caseShow || false;
|
||||
this.formModel.helpShow = viewSetting.helpShow || false;
|
||||
|
||||
this.formModel.judgeRoute = viewSetting.judgeRoute || '';
|
||||
this.formModel.baseApiUrl = viewSetting.baseApiUrl || '';
|
||||
this.formModel.baseSite = viewSetting.baseSite || '';
|
||||
this.formModel.ossUrl = viewSetting.ossUrl || '';
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
@ -137,8 +172,15 @@ export default {
|
||||
|
||||
browserTitle:'', // 浏览器页签名称
|
||||
homeTitle:'', // 导航栏名称
|
||||
navLogoWidth:'', // 导航栏Logo宽度
|
||||
navLogoHeight:'', // 导航栏Logo高度
|
||||
caseShow:true, // 导航栏案例展示是否展示
|
||||
helpShow:true // 导航栏帮助展示是否展示
|
||||
helpShow:true, // 导航栏帮助展示是否展示
|
||||
|
||||
judgeRoute:'', // 跳转路径
|
||||
baseApiUrl:'', // api链接
|
||||
baseSite:'', // 当前域名
|
||||
ossUrl:'' // 文件oss地址
|
||||
|
||||
};
|
||||
this.$refs.ruleForm.resetFields();
|
||||
@ -162,6 +204,56 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
uploadLogo() {
|
||||
const pic = document.getElementById('upload_file');
|
||||
if (!pic.files || !pic.files[0]) {
|
||||
return;
|
||||
}
|
||||
const file = pic.files[0];
|
||||
const mineType = file.type;
|
||||
const fileSize = file.size;
|
||||
if (mineType != 'image/png' && mineType != 'image/jpeg') {
|
||||
this.$message.error('仅支持png和jpeg格式的图片');
|
||||
return;
|
||||
}
|
||||
if (fileSize / (1024 * 1024) > 1) {
|
||||
this.$message.error('图片应该小于1M');
|
||||
return;
|
||||
}
|
||||
const fileArray = file.name.split('.');
|
||||
const fileType = fileArray[fileArray.length - 1] || '';
|
||||
if (!fileType) {
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
directory:'logo',
|
||||
fileName:'favicon_' + this.row.markKey + '.' + fileType,
|
||||
method:'PUT'
|
||||
};
|
||||
const that = this;
|
||||
getUploadUrl(params).then((response) => {
|
||||
const url = response.data;
|
||||
if (url) {
|
||||
// var formData = new FormData();
|
||||
// formData.append('body', file);
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('PUT', url);
|
||||
xhr.setRequestHeader('Content-Type', 'multipart/form-data');
|
||||
xhr.send(file);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status == 200) {
|
||||
that.formModel.loginProLogo = params.fileName;
|
||||
} else if (xhr.status != 200) {
|
||||
that.$message.error('上传失败,请稍后再试');
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// 参数:directory:MINIO文件夹
|
||||
// fileName:存储文件名
|
||||
// method:生成链接的请求方式
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -170,4 +262,47 @@ export default {
|
||||
.inlineBlock{
|
||||
display: inline-block;
|
||||
}
|
||||
.eachButton{
|
||||
margin-left:10px;
|
||||
width:100px;
|
||||
height:100px;
|
||||
border:1px #ccc dashed;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-icon-other{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
line-height: 98px;
|
||||
font-size: 16px;
|
||||
position: absolute;
|
||||
color: #000;
|
||||
}
|
||||
// .file_box:hover + .el-icon-other{
|
||||
// background: rgba(0, 0, 0, 0.5);
|
||||
// position: absolute;
|
||||
// color: #000;
|
||||
// }
|
||||
.uploadLogo {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
// float: right;
|
||||
margin-right: 3px;
|
||||
cursor: pointer;
|
||||
input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.loginLogo{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
</style>
|
||||
|
22
src/views/temporary/index.vue
Normal file
22
src/views/temporary/index.vue
Normal file
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<div class="temporary">
|
||||
<span>功能实现中......</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'Temporary',
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.temporary {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
12
src/views/temporary/transitionIndex.vue
Normal file
12
src/views/temporary/transitionIndex.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<router-view />
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'NullIndex',
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user