Commit a051d5a2 by 姜雷

Merge branch 'develop' into 'test'

Develop See merge request !93
parents 9dbfa7f3 3ed2c383
...@@ -19,7 +19,8 @@ let logout = false; ...@@ -19,7 +19,8 @@ let logout = false;
// request拦截器 // request拦截器
service.interceptors.request.use( service.interceptors.request.use(
conf => { conf => {
store.dispatch('fetchStart'); const { notLoading } = conf;
store.dispatch('fetchStart', notLoading);
if (store.getters.token) { if (store.getters.token) {
conf.headers = { conf.headers = {
...conf.headers, ...conf.headers,
...@@ -51,7 +52,8 @@ service.interceptors.response.use(response => { ...@@ -51,7 +52,8 @@ service.interceptors.response.use(response => {
* code为非'0'是抛错 * code为非'0'是抛错
*/ */
setTimeout(() => { setTimeout(() => {
store.dispatch('fetchDone'); const { notLoading } = response.config;
store.dispatch('fetchDone', notLoading);
}, 500); }, 500);
if (res.code !== SUCCESS_CODE) { if (res.code !== SUCCESS_CODE) {
if ( if (
......
...@@ -18,6 +18,7 @@ const initAction = () => ({ ...@@ -18,6 +18,7 @@ const initAction = () => ({
fetchDashboardAreaList({ commit }, entity) { fetchDashboardAreaList({ commit }, entity) {
return fetchDashboardAreaList({ return fetchDashboardAreaList({
data: entity, data: entity,
notLoading: true,
}).then(res => { }).then(res => {
const list = res.data; const list = res.data;
commit(GET_AREA_LIST, list); commit(GET_AREA_LIST, list);
......
...@@ -20,7 +20,8 @@ const createBaseFetch = config => { ...@@ -20,7 +20,8 @@ const createBaseFetch = config => {
// request拦截器 // request拦截器
service.interceptors.request.use( service.interceptors.request.use(
conf => { conf => {
store.dispatch('fetchStart'); const { notLoading } = conf;
store.dispatch('fetchStart', notLoading);
if (store.getters.token) { if (store.getters.token) {
conf.headers = { conf.headers = {
...conf.headers, ...conf.headers,
...@@ -52,7 +53,8 @@ const createBaseFetch = config => { ...@@ -52,7 +53,8 @@ const createBaseFetch = config => {
* code为非'0'是抛错 * code为非'0'是抛错
*/ */
setTimeout(() => { setTimeout(() => {
store.dispatch('fetchDone'); const { notLoading } = response.config;
store.dispatch('fetchDone', notLoading);
}, 500); }, 500);
if (res.code !== SUCCESS_CODE) { if (res.code !== SUCCESS_CODE) {
if ( if (
......
...@@ -19,7 +19,7 @@ const constantRouterMap = [ ...@@ -19,7 +19,7 @@ const constantRouterMap = [
icon: HomeIcon, icon: HomeIcon,
store: require('@/containers/Dashboard/store').default, store: require('@/containers/Dashboard/store').default,
}, },
component: _import('Home/Home'), component: _import('HomePage/Home'),
}, },
{ {
path: '/dashboard', path: '/dashboard',
......
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