问题调整

This commit is contained in:
fan 2019-10-25 12:59:24 +08:00
parent 0c67d2a077
commit bfce5a2103
13 changed files with 40 additions and 66 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -31,22 +31,22 @@ export default {
{
name: 'global.designPlatformEntrance',
handle: this.goToDesign,
hidden: getSessionStorage('design')
hidden: getSessionStorage('project') === 'design'
},
{
name: 'global.trainingPlatformEntrance',
handle: this.goToTraining,
hidden: !getSessionStorage('design')
hidden: getSessionStorage('project') !== 'design'
},
{
name: 'global.scan',
handle: this.qcodeEntry,
hidden: process.env.NODE_ENV != 'development' || getSessionStorage('design')
hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project') === 'design'
},
{
name: 'global.quickEntry',
handle: this.quickEntry,
hidden: getSessionStorage('design')
hidden: getSessionStorage('project') === 'design'
},
{
name: LangStorage.getLang('zh')==='zh'?'English':'中文',

View File

@ -1,39 +1,30 @@
<template>
<div class="avatar-container" style="margin-left:40px;">
<img class="logo" :src="logoImg" @click="goToMain"/>
<img class="logo" :src="logoImg" @click="goToMain">
<div class="titleInner" style="margin-left:60px;" @click="goToMain">{{ systemTitle }}</div>
</div>
</template>
<script>
import logoImg from '@/assets/logo_changan.png';
import { getSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index';
import { loginTitle } from '@/scripts/ConstDic';
export default {
data() {
return {
logoImg: logoImg,
systemTitle:"城市轨道交通实训平台"
systemTitle: '城市轨道交通实训平台'
};
},
mounted() {
if (getSessionStorage('design')) {
this.systemTitle="城市轨道交通设计平台";
}
else{
this.systemTitle=loginTitle[getSessionStorage('project')||'default'];
}
this.systemTitle=loginTitle[getSessionStorage('project')];
},
methods: {
goToMain() {
// if (getSessionStorage('design')) {
// this.$router.push({ path: `${UrlConfig.design.prefix}/home`});
// }
}
}
}
};
</script>
<style lang="scss" scoped>
.main-container .navbar .avatar-container {

View File

@ -32,8 +32,7 @@ function getRouteInfo(to) {
getTokenInfo = getDesignToken;
clientId = LoginParams.Design.clientId;
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath)) {
const flag = getSessionStorage('design');
if (flag == 'true') {
if (getSessionStorage('project')==='design') {
loginPath = loginDesignPage;
getTokenInfo = getDesignToken;
clientId = LoginParams.Design.clientId;
@ -56,9 +55,8 @@ function handleRoute(to, from, next, routeInfo) {
// 拉取用户信息
store.dispatch('GetInfo', routeInfo.getTokenInfo).then(res => {
// 根据roles权限生成可访问的路由表
// debugger;
const roles = res.roles;
if (getSessionStorage('design')) {
if (getSessionStorage('project')==='design') {
roles.push(userDesign);
}
store.dispatch('GenerateRoutes', { roles, clientId: routeInfo.clientId }).then(() => {
@ -82,7 +80,7 @@ function handleRoute(to, from, next, routeInfo) {
// 除没有动态改变权限的需求可直接next() 删下方权限判断
if (hasPermission(store.getters.roles, to.meta.roles)) {
if (to.path==='/404' && to.redirectedFrom==='/') {
if (getSessionStorage('design') === 'true') {
if (getSessionStorage('project') === 'design') {
next('/design/home');
} else {
next(localStore.get('trainingPlatformRoute'+store.getters.id) ||'/trainingPlatform');

View File

@ -1065,7 +1065,7 @@ const router = createRouter();
router.beforeEach((to, from, next) => {
const project = getSessionStorage('project');
document.title = loginTitle[project];
document.title = loginTitle[project||'login'];
next();
});

View File

@ -1,6 +1,6 @@
module.exports = {
title: '城市轨道交通实训平台',
title: '',
/**
* @type {boolean} true | false

View File

@ -48,7 +48,7 @@ function hasPermission(roles, route, parentsRoles) {
// }
// }
// return roles.some(role => route.meta.roles.indexOf(role) >= 0);
if (getSessionStorage('design')) {
if (getSessionStorage('project')==='design') {
roles= roles.filter(function (role) {
return route.meta.roles.indexOf(role) >= 0;
});

View File

@ -1,4 +1,4 @@
import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
import { setSessionStorage } from '@/utils/auth';
import { login, logout, getInfo } from '@/api/login';
import { getToken, setToken, removeToken, getDesignToken, setDesignToken, removeDesignToken, handleToken, handleRemoveToken } from '@/utils/auth';
import { getUserConfigInfo } from '@/api/management/user';
@ -88,12 +88,6 @@ const user = {
// 登录系统
login(params).then(resp => {
if (userInfo.type == 'design') {
removeSessionStorage('design');
setSessionStorage('design', true);
} else {
removeSessionStorage('design');
}
execFc(resp.data);
resolve();
}).catch(error => { reject(error); });
@ -104,7 +98,6 @@ const user = {
QrLoginSetting({ dispatch, commit }, token) {
return new Promise((resolve, reject) => {
// 设置user域token值
removeSessionStorage('design');
commit(token.key, token.value);
const header = { group: '', 'X-Token': token.value };
creatSubscribe(perpetualTopic, header);
@ -173,7 +166,6 @@ const user = {
commit('SET_TOKEN', '');
commit('SET_ROLES', []);
commit('SET_ID', '');
removeSessionStorage('design');
Cookies.remove('UserDesignName');
Cookies.remove('UserDesignToken');
Cookies.remove('UserName');

View File

@ -105,7 +105,7 @@ export default {
launchFullscreen();
await putJointTrainingSimulationEntrance(this.group);
const rest = await getPublishMapInfo(this.mapId);
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group };
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
} else if (this.state == '01') {
const query = { group: this.group };

View File

@ -298,7 +298,7 @@ export default {
back() {
this.$store.dispatch('training/over').then(() => {
putJointTrainingSimulationUser(this.group).then(() => {
this.$router.push({ path: `/trainroom`, query: { skinCode: this.$route.query.skinCode, group: this.group, subSystem: this.$route.query.subSystem } });
this.$router.replace({ path: `/trainroom`, query: { skinCode: this.$route.query.skinCode, group: this.group, subSystem: this.$route.query.subSystem } });
exitFullscreen();
});
});

View File

@ -173,7 +173,6 @@ export default {
model.type = this.modelType;
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username);
this.setProjectSession();
this.handleLoginSucessRoute();
}).catch(error => {
if (error.code==='30001') {
@ -204,12 +203,6 @@ export default {
removeDesignToken();
setSessionStorage('project', this.project);
},
setProjectSession() {
if (this.project === 'design') {
removeSessionStorage('design');
setSessionStorage('design', true);
}
},
clearTimer(timer) {
if (timer) {
clearTimeout(timer);
@ -289,7 +282,6 @@ export default {
}
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username);
this.setProjectSession();
this.handleLoginSucessRoute();
}).catch(error => {
if (error.code==='30001') {

View File

@ -3,7 +3,7 @@
<pop-menu ref="popMenu" :menu="menu" />
<map-edit ref="edit" :basic-info="true" :map="editModel" :skin-code="skinCode" @refresh="refresh" />
<!-- <map-edit ref="axisEdit" :basic-info="false" :map="editModel" :skin-code="skinCode" @refresh="refresh" /> -->
<!-- <map-save-as ref="saveAs" :map="editModel" @refresh="refresh" /> -->
<map-save-as ref="saveAs" :map="editModel" @refresh="refresh" />
<map-publish ref="publish" :map="editModel" />
</div>
</template>
@ -14,7 +14,7 @@ import { DeviceMenu } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index';
import PopMenu from '@/components/PopMenu';
import MapEdit from './edit';
// import MapSaveAs from './saveAs';
import MapSaveAs from './saveAs';
import MapPublish from './publish';
import { mapGetters } from 'vuex';
@ -23,7 +23,7 @@ export default {
components: {
PopMenu,
MapEdit,
// MapSaveAs,
MapSaveAs,
MapPublish
},
props: {
@ -51,10 +51,10 @@ export default {
// label: this.$t('map.updateObjAxis'),
// handler: this.updateObjAxis
// },
// {
// label: this.$t('map.saveAs'),
// handler: this.saveAs
// },
{
label: this.$t('map.saveAs'),
handler: this.saveAs
},
{
label: this.$t('map.deleteObj'),
handler: this.deleteObj

View File

@ -462,7 +462,8 @@ export default {
};
if (data.state == '03') { //
this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}});
// this.$router.push({ path: `/trainingPlatform/detail/${this.$route.query.subSystem}`, query: {mapId: this.mapId}});
this.$router.go(-1);
} else if (data.state == '01') { //
this.starting = false;
} else if (data.state == '02') {
@ -470,7 +471,7 @@ export default {
await putJointTrainingSimulationEntrance(param.group);
const rest = await getPublishMapInfo(param.mapId);
const query = { skinCode: rest.data.skinCode, mapId: param.mapId, group: param.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
this.$router.replace({ path: `/jointTraining`, query: query });
launchFullscreen();
}
this.$store.dispatch('socket/setJointRoomInfo'); //
@ -492,7 +493,7 @@ export default {
await putJointTrainingSimulationEntrance(this.$route.query.group);
const rest = await getPublishMapInfo(this.mapId);
const query = { skinCode: rest.data.skinCode, mapId: this.mapId, group: this.$route.query.group, subSystem: this.$route.query.subSystem };
this.$router.push({ path: `/jointTraining`, query: query });
this.$router.replace({ path: `/jointTraining`, query: query });
launchFullscreen();
},
// 线/线