Commit 39baa2d2 authored by 晓彤's avatar 晓彤

修改

parent 127e03dd
import Vue from 'vue'
// import store from '../store/store'
import NProgress from 'nprogress' // Progress 进度条
import 'nprogress/nprogress.css' // Progress 进度条样式
import Router from 'vue-router'
import Login from '../views/login/Login'
import Main from '../views/Main'
......@@ -213,10 +215,12 @@ const router = new Router({
})
// 判断用户是否登陆到系统
router.beforeEach(function(to, from, next) {
NProgress.start()
var token = window.sessionStorage.getItem('token')
if (token !== null) {
if (to.path === '/login') {
next('/main')
NProgress.done() // 结束Progress
} else if (to.path === '/main') {
next()
} else {
......@@ -225,6 +229,7 @@ router.beforeEach(function(to, from, next) {
next()
} else {
next('/main')
NProgress.done() // 结束Progress
}
}
} else {
......@@ -232,7 +237,12 @@ router.beforeEach(function(to, from, next) {
next()
} else {
next('/login')
NProgress.done() // 结束Progress
}
}
})
router.afterEach(() => {
NProgress.done() // 结束Progress
})
export default router
......@@ -19,7 +19,7 @@
<el-table-column label="操作">
<slot slot-scope="scope">
<el-button type="success" size="medium" icon="el-icon-link" @click="executeSceneFrom(scope.row)" style="width:80px;margin-left:1px">执行</el-button>
<el-button type="warning" size="medium" icon="el-icon-edit-outline" @click="editeSceneCaseFrom(scope.row)" style="width:135px;margin-left:1px" v-permission="('auto:scene:case:edit')" >编辑场景用例</el-button>
<el-button type="warning" size="medium" icon="el-icon-edit-outline" @click="editeSceneCaseFrom(scope.row)" style="width:135px;margin-left:1px" v-permission="('auto:scene:case:edit')">编辑场景用例</el-button>
<el-button type="warning" size="medium" icon="el-icon-edit" @click="editeSceneFrom(scope.row)" style="width:110px;margin-left:1px" v-permission="('auto:scene:edit')">编辑场景</el-button>
<el-button type="primary" size="medium" icon="el-icon-circle-check" @click="checkReport(scope.row)" style="width:110px;margin-left:1px">查看报告</el-button>
<el-button type="danger" icon="el-icon-delete" @click="deleSceneFrom(scope.row)" v-permission="('auto:scene:del')">删除</el-button>
......@@ -170,6 +170,7 @@ export default {
executeScene(this.executeScene)
.then((resp) => {
this.requestData = resp.data.data
console.log('888', this.requestData)
if (this.requestData.length > 0) {
this.isShow = true
this.$message.success('执行成功!')
......
......@@ -97,6 +97,7 @@ export default {
// this.$store.dispatch('user/userMsg', {
// userInfo: resp.data.data
// })
// 判断token失效时,清空缓存,跳转到登陆页面
if (resp.data.data === false) {
this.$message.error(resp.data.msg)
window.sessionStorage.clear()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment