b7ef5199 by xiaomiao

Merge branch 'dev' of http://yun.pashanhoo.com:9090/bdc/bdcdj-web into dev

2 parents 8f1d7dda 7505abaf
......@@ -77,7 +77,7 @@
if (process.env.NODE_ENV === 'development') {
localStorage.removeItem('token')
} else {
Cookies.remove('token')
Cookies.remove('ACCESS_TOKEN')
}
if (window._config.casEnable) {
window.location.href = window._config.casBaseURL + '/logout?service=' + encodeURIComponent(window.location.href);
......
......@@ -8,12 +8,13 @@ import axios from 'axios'
import router from './router'
import store from './store'
import Cookies from 'js-cookie'
import { getMenuInfo } from '@/api/user'
import { getUrlParam } from '@/utils/operation'
import {getMenuInfo} from '@/api/user'
import {getUrlParam} from '@/utils/operation'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import getPageTitle from '@/utils/get-page-title'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
NProgress.configure({showSpinner: false}) // NProgress Configuration
router.beforeEach(async (to, from, next) => {
Vue.prototype.$currentRoute = to
......@@ -22,7 +23,7 @@ router.beforeEach(async (to, from, next) => {
let hasAddDict = store.state.dict.addDict
let hasAddRoute = store.state.permission.addRoutes
// cas操作
const token = localStorage.getItem("token") || Cookies.get('token');
const token = localStorage.getItem("token") || Cookies.get('ACCESS_TOKEN');
if (to.path === '/login') {
if (token) {
next('/')
......@@ -45,7 +46,7 @@ router.beforeEach(async (to, from, next) => {
if (process.env.NODE_ENV === 'development') {
localStorage.setItem('token', res.data.content.accessToken)
} else {
Cookies.set('token', res.data.content.accessToken)
Cookies.set('ACCESS_TOKEN', res.data.content.accessToken)
}
window.location.href = localStorage.getItem('location')
......@@ -59,7 +60,8 @@ router.beforeEach(async (to, from, next) => {
} else {
permission()
}
async function permission () {
async function permission() {
if (!hasAddDict) {
store.dispatch('dict/generateDic')
}
......@@ -67,14 +69,14 @@ router.beforeEach(async (to, from, next) => {
next()
// next({ ...to, replace: true })
} else {
const { result: getMenuData } = await getMenuInfo()
const {result: getMenuData} = await getMenuInfo()
const accessRoutes = await store.dispatch('permission/generateRoutes', getMenuData)
// 获取用户信息
await store.dispatch('user/getUserInfo')
router.addRoutes([...accessRoutes, { path: '*', redirect: '/404', hidden: true }])
router.addRoutes([...accessRoutes, {path: '*', redirect: '/404', hidden: true}])
const routeTo = Cookies.get('routerTo')
if (routeTo && routeTo !== '/') {
next({ ...to, replace: true })
next({...to, replace: true})
} else {
next('/home')
}
......
......@@ -34,14 +34,6 @@ service.interceptors.request.use(
} else {
config.headers.delete('Authorization')
}
} else {
const token = Cookies.get('token')
// 添加请求头
if (token) {
config.headers['Authorization'] = 'Bearer ' + token
} else {
config.headers.delete('Authorization')
}
}
return config
},
......@@ -78,7 +70,7 @@ service.interceptors.response.use(
if (process.env.NODE_ENV === 'development') {
localStorage.removeItem('token')
} else {
Cookies.remove('token')
Cookies.remove('ACCESS_TOKEN')
}
if (window._config.casEnable) {
window.location.href = window._config.casBaseURL + '/logout?service=' + encodeURIComponent(locationUrl);
......@@ -92,7 +84,6 @@ service.interceptors.response.use(
return false
}
}
} else {
// 对响应错误做点什么
Message({
......
......@@ -58,7 +58,7 @@
</div>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item :class="flag ? 'marginBot0' : ''" label="权利人:" prop="qlxx.qlrmc">
<el-form-item :class="flag ? 'marginBot0' : ''" label="被执行人:" prop="qlxx.qlrmc">
<el-input disabled v-model="ruleForm.ssQlxx.qlrmc"></el-input>
</el-form-item>
</el-col>
......