城市轨道交通实训平台
@@ -157,13 +156,13 @@ export default {
return true;
}
return false;
- },
- goToTraining(){
- let routeData = this.$router.resolve({
- path: "/",
+ },
+ goToTraining() {
+ const routeData = this.$router.resolve({
+ path: '/'
});
window.open(routeData.href, '_blank');
- }
+ }
}
};
@@ -202,26 +201,6 @@ export default {
display: inline-block;
position: relative;
margin-right:10px;
- // position: absolute;
- // right: 35px;
-
- .avatar-wrapper {
- cursor: pointer;
- position: relative;
-
- .user-avatar {
- width: 40px;
- height: 40px;
- border-radius: 10px;
- }
-
- .el-icon-caret-bottom {
- position: absolute;
- right: -20px;
- top: 25px;
- font-size: 12px;
- }
- }
}
}
diff --git a/src/permission.js b/src/permission.js
index f26e99c7d..f26236303 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -5,9 +5,9 @@ import NProgress from 'nprogress'; // Progress 进度条
import 'nprogress/nprogress.css';// Progress 进度条样式
import { admin, userDesign} from './router';
import { getToken, getScreenToken, getDesignToken} from '@/utils/auth'; // 验权
-// getPlanToken
import { LoginParams } from '@/utils/login';
import { getSessionStorage } from '@/utils/auth';
+import localStore from 'storejs';
function hasPermission(roles, permissionRoles) {
if (roles.indexOf(admin) >= 0) return true;
@@ -29,7 +29,6 @@ function getRouteInfo(to) {
let getTokenInfo = () => { };
let clientId = '';
const toRoutePath = to.redirectedFrom || to.path;
-
if (/^\/dp/.test(toRoutePath) || /^\/display\/dp/.test(toRoutePath)) {
loginPath = loginScreenPage;
getTokenInfo = getScreenToken;
@@ -88,7 +87,15 @@ function handleRoute(to, from, next, routeInfo) {
} else {
// 除没有动态改变权限的需求可直接next() 删下方权限判断
if (hasPermission(store.getters.roles, to.meta.roles)) {
- next();
+ if (to.path==='/404' && to.redirectedFrom==='/') {
+ if (getSessionStorage('design') === 'true') {
+ next('/design/home');
+ } else {
+ next(localStore.get('trainingPlatformRoute'+store.getters.id) ||'/trainingPlatform');
+ }
+ } else {
+ next();
+ }
} else {
next({ path: '/401', replace: true, query: { noGoBack: true } });
}
diff --git a/src/router/index.js b/src/router/index.js
index 5199ad88b..1898707c2 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -153,13 +153,13 @@ export const userPlan = '015'; // 计划系统
export const userDesign='016'; // 设计系统
const isDev = process.env.NODE_ENV === 'development';
-const design = getSessionStorage('design');
-let redirectPath = '';
-if (design === 'true') {
- redirectPath = '/design/home';
-} else {
- redirectPath = '/trainingPlatform';
-}
+// const design = getSessionStorage('design');
+// let redirectPath = '';
+// if (design === 'true') {
+// redirectPath = '/design/home';
+// } else {
+// redirectPath = '/trainingPlatform';
+// }
export const UrlConfig = {
display: '/display',
@@ -321,11 +321,11 @@ export const constantRoutes = [
component: Jlmap3dedit,
hidden: true
},
- {
- path: '/',
- redirect: redirectPath,
- hidden: true
- },
+ // {
+ // path: '/',
+ // redirect: redirectPath,
+ // hidden: true
+ // },
{
path: '/401',
component: Error401,
diff --git a/src/store/getters.js b/src/store/getters.js
index 843d1289b..a1071dd74 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -11,6 +11,7 @@ const getters = {
roles: state => state.user.roles,
canvasWidth: state => state.config.width,
canvasHeight: state => state.config.height,
+ id: state => state.user.id,
permission_routes: state => state.permission.routes
};
export default getters;
From a1761fd2fcfe5858b346b2e78b03bdfabf9e9f0c Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Wed, 23 Oct 2019 19:15:02 +0800
Subject: [PATCH 12/12] =?UTF-8?q?=E6=B7=BB=E5=8A=A0copyRight?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layout/index.vue | 5 ++++-
src/views/designPlatform/home.vue | 2 +-
src/views/designPlatform/index.vue | 2 +-
src/views/jlmap/index.vue | 3 ++-
src/views/planMonitor/detail.vue | 2 +-
src/views/scriptManage/home.vue | 2 +-
6 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/layout/index.vue b/src/layout/index.vue
index edf1684bd..d1669aa3d 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -3,6 +3,9 @@
+
+ Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号
+
@@ -37,7 +40,7 @@ export default {
return this.$store.state.app.width;
},
height() {
- return this.$store.state.app.height - 60;
+ return this.$store.state.app.height - 60-30;
}
},
created() {
diff --git a/src/views/designPlatform/home.vue b/src/views/designPlatform/home.vue
index 76c1054a8..d4c5d5fd9 100644
--- a/src/views/designPlatform/home.vue
+++ b/src/views/designPlatform/home.vue
@@ -44,7 +44,7 @@
},
computed: {
height() {
- return this.$store.state.app.height - 50;
+ return this.$store.state.app.height - 50-30;
}
}
};
diff --git a/src/views/designPlatform/index.vue b/src/views/designPlatform/index.vue
index 2c903257f..b3e427ad1 100644
--- a/src/views/designPlatform/index.vue
+++ b/src/views/designPlatform/index.vue
@@ -40,7 +40,7 @@ export default {
'lessonbar'
]),
height() {
- return this.$store.state.app.height - 50;
+ return this.$store.state.app.height - 50-30;
},
width() {
return this.$store.state.app.width;
diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue
index 3ba5e7984..3ad9b9580 100644
--- a/src/views/jlmap/index.vue
+++ b/src/views/jlmap/index.vue
@@ -281,7 +281,8 @@ export default {
}
.zoom-view {
- position: fixed;
+ // position: fixed;
+ position: absolute;
height: 28px;
}
diff --git a/src/views/planMonitor/detail.vue b/src/views/planMonitor/detail.vue
index 3b148e9b8..d6e5dc512 100644
--- a/src/views/planMonitor/detail.vue
+++ b/src/views/planMonitor/detail.vue
@@ -75,7 +75,7 @@ export default {
},
computed: {
height() {
- return this.$store.state.app.height - 50;
+ return this.$store.state.app.height - 50-30;
},
skinCode() {
return this.$route.query.skinCode || '02';
diff --git a/src/views/scriptManage/home.vue b/src/views/scriptManage/home.vue
index 661db766e..9d778d905 100644
--- a/src/views/scriptManage/home.vue
+++ b/src/views/scriptManage/home.vue
@@ -116,7 +116,7 @@ export default {
},
computed: {
height() {
- return this.$store.state.app.height - 50;
+ return this.$store.state.app.height - 50-30;
}
},
watch: {