update
This commit is contained in:
parent
da5ce816d2
commit
909101729e
|
@ -1,5 +1,5 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import SvgIcon from '@/components/SvgIcon'// svg组件
|
import SvgIcon from '@/components/SvgIcon'// svg component
|
||||||
|
|
||||||
// register globally
|
// register globally
|
||||||
Vue.component('svg-icon', SvgIcon)
|
Vue.component('svg-icon', SvgIcon)
|
||||||
|
|
|
@ -71,9 +71,9 @@ export const constantRoutes = [
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '/',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: 'dashboard',
|
redirect: '/dashboard',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'dashboard',
|
path: 'dashboard',
|
||||||
|
@ -369,6 +369,7 @@ export const asyncRoutes = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 404 page must be placed at the end !!!
|
||||||
{ path: '*', redirect: '/404', hidden: true }
|
{ path: '*', redirect: '/404', hidden: true }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ const actions = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// Dynamically modify permissions
|
// dynamically modify permissions
|
||||||
changeRoles({ commit, dispatch }, role) {
|
changeRoles({ commit, dispatch }, role) {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
const token = role + '-token'
|
const token = role + '-token'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Created by jiachenpan on 16/11/18.
|
* Created by PanJiaChen on 16/11/18.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
*Created by jiachenpan on 16/11/29.
|
*Created by PanJiaChen on 16/11/29.
|
||||||
* @param {Sting} url
|
* @param {Sting} url
|
||||||
* @param {Sting} title
|
* @param {Sting} title
|
||||||
* @param {Number} w
|
* @param {Number} w
|
||||||
|
|
|
@ -16,8 +16,9 @@ service.interceptors.request.use(
|
||||||
// do something before request is sent
|
// do something before request is sent
|
||||||
|
|
||||||
if (store.getters.token) {
|
if (store.getters.token) {
|
||||||
// let each request carry token --['X-Token'] as a custom key.
|
// let each request carry token
|
||||||
// please modify it according to the actual situation.
|
// ['X-Token'] is a custom headers key
|
||||||
|
// please modify it according to the actual situation
|
||||||
config.headers['X-Token'] = getToken()
|
config.headers['X-Token'] = getToken()
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
|
@ -32,14 +33,14 @@ service.interceptors.request.use(
|
||||||
// response interceptor
|
// response interceptor
|
||||||
service.interceptors.response.use(
|
service.interceptors.response.use(
|
||||||
/**
|
/**
|
||||||
* If you want to get information such as headers or status
|
* If you want to get http information such as headers or status
|
||||||
* Please return response => response
|
* Please return response => response
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the request status by custom code
|
* Determine the request status by custom code
|
||||||
* Here is just an example
|
* Here is just an example
|
||||||
* You can also judge the status by HTTP Status Code.
|
* You can also judge the status by HTTP Status Code
|
||||||
*/
|
*/
|
||||||
response => {
|
response => {
|
||||||
const res = response.data
|
const res = response.data
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Created by jiachenpan on 16/11/18.
|
* Created by PanJiaChen on 16/11/18.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue