Commit c494868d by 姜雷

添加区域选择框不loading

parent eb48e21a
...@@ -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 (
......
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