From cc4bfb58deaf0b6bf90d0a093283aaf5f74707b8 Mon Sep 17 00:00:00 2001 From: johnniang Date: Thu, 6 Jun 2019 13:55:11 +0800 Subject: [PATCH] Mute some apis --- src/api/admin.js | 3 ++- src/api/post.js | 1 + src/utils/service.js | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/admin.js b/src/api/admin.js index e1f02f0d..79befc55 100644 --- a/src/api/admin.js +++ b/src/api/admin.js @@ -7,7 +7,8 @@ const adminApi = {} adminApi.counts = () => { return service({ url: `${baseUrl}/counts`, - method: 'get' + method: 'get', + mute: true }) } diff --git a/src/api/post.js b/src/api/post.js index cd8fba42..0d0a1b32 100644 --- a/src/api/post.js +++ b/src/api/post.js @@ -34,6 +34,7 @@ postApi.create = (postToCreate, autoSave) => { url: baseUrl, method: 'post', data: postToCreate, + mute: autoSave, params: { autoSave: autoSave } diff --git a/src/utils/service.js b/src/utils/service.js index f89efd22..a9c69246 100644 --- a/src/utils/service.js +++ b/src/utils/service.js @@ -63,7 +63,9 @@ function getFieldValidationError(data) { service.interceptors.request.use( config => { - NProgress.start() + if (!config.mute) { + NProgress.start() + } // TODO set token setTokenToHeader(config) return config