From 909101729e216c86521a5f8cd3651b1174f16f5d Mon Sep 17 00:00:00 2001 From: Pan Date: Fri, 19 Apr 2019 18:14:32 +0800 Subject: [PATCH] update --- src/icons/index.js | 2 +- src/router/index.js | 5 +++-- src/store/modules/user.js | 2 +- src/utils/index.js | 2 +- src/utils/open-window.js | 2 +- src/utils/request.js | 9 +++++---- src/utils/validate.js | 2 +- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/icons/index.js b/src/icons/index.js index c1c2e792..2c6b309c 100644 --- a/src/icons/index.js +++ b/src/icons/index.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import SvgIcon from '@/components/SvgIcon'// svg组件 +import SvgIcon from '@/components/SvgIcon'// svg component // register globally Vue.component('svg-icon', SvgIcon) diff --git a/src/router/index.js b/src/router/index.js index 88c8324b..4d86cdf3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -71,9 +71,9 @@ export const constantRoutes = [ hidden: true }, { - path: '', + path: '/', component: Layout, - redirect: 'dashboard', + redirect: '/dashboard', children: [ { path: 'dashboard', @@ -369,6 +369,7 @@ export const asyncRoutes = [ ] }, + // 404 page must be placed at the end !!! { path: '*', redirect: '/404', hidden: true } ] diff --git a/src/store/modules/user.js b/src/store/modules/user.js index f27615b0..d2b2e67a 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -97,7 +97,7 @@ const actions = { }) }, - // Dynamically modify permissions + // dynamically modify permissions changeRoles({ commit, dispatch }, role) { return new Promise(async resolve => { const token = role + '-token' diff --git a/src/utils/index.js b/src/utils/index.js index c0ee5026..ffb55260 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,5 +1,5 @@ /** - * Created by jiachenpan on 16/11/18. + * Created by PanJiaChen on 16/11/18. */ /** diff --git a/src/utils/open-window.js b/src/utils/open-window.js index 657bd190..1a655d77 100644 --- a/src/utils/open-window.js +++ b/src/utils/open-window.js @@ -1,5 +1,5 @@ /** - *Created by jiachenpan on 16/11/29. + *Created by PanJiaChen on 16/11/29. * @param {Sting} url * @param {Sting} title * @param {Number} w diff --git a/src/utils/request.js b/src/utils/request.js index d3c25c00..bc346a8c 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -16,8 +16,9 @@ service.interceptors.request.use( // do something before request is sent if (store.getters.token) { - // let each request carry token --['X-Token'] as a custom key. - // please modify it according to the actual situation. + // let each request carry token + // ['X-Token'] is a custom headers key + // please modify it according to the actual situation config.headers['X-Token'] = getToken() } return config @@ -32,14 +33,14 @@ service.interceptors.request.use( // response interceptor 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 */ /** * Determine the request status by custom code * 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 => { const res = response.data diff --git a/src/utils/validate.js b/src/utils/validate.js index e81672bb..6b3ac418 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -1,5 +1,5 @@ /** - * Created by jiachenpan on 16/11/18. + * Created by PanJiaChen on 16/11/18. */ /**