From 95d0e5524c3ab1e55a9909e2c38e7cc35901220f Mon Sep 17 00:00:00 2001 From: 劉鈞霖 <benson@gmail.com> Date: 星期三, 15 十二月 2021 14:52:58 +0800 Subject: [PATCH] [ Update ] :新增 pamService class 將 consultant interface 移出 --- PAMapp/assets/ts/services/httpClient.ts | 32 +++++++++++++++++++------------- 1 files changed, 19 insertions(+), 13 deletions(-) diff --git a/PAMapp/assets/ts/services/httpClient.ts b/PAMapp/assets/ts/services/httpClient.ts index 68a8ba8..531eda2 100644 --- a/PAMapp/assets/ts/services/httpClient.ts +++ b/PAMapp/assets/ts/services/httpClient.ts @@ -42,26 +42,32 @@ } function loadingStart(): void { - window.$nuxt.$loading.start(); + setTimeout(() => { + window.$nuxt.$loading.start(); + }, 0); }; function loadingFinish(): void { - window.$nuxt.$loading.finish(); + setTimeout(() => { + window.$nuxt.$loading.finish(); + }, 0); }; function showErrorMessageBox(error: any): void { // console.log('error', error, error.response); - if (!_.includes(notRequireInterceptorErrorUrl, error.config.url)) { - switch (error.response.status) { - case 401: - Promise.all([ErrorMessageBox('���暹��'), window.$nuxt.$store.dispatch('localStorage/actionStorageClear')]).then(() => { - _.isEqual(window.$nuxt.$route.name, 'index') ? location.reload() : window.$nuxt.$router.push('/'); - }); - break; + setTimeout(() => { + if (!_.includes(notRequireInterceptorErrorUrl, error.config.url)) { + switch (error.response.status) { + case 401: + Promise.all([ErrorMessageBox('���暹��'), window.$nuxt.$store.dispatch('localStorage/actionStorageClear')]).then(() => { + _.isEqual(window.$nuxt.$route.name, 'index') ? location.reload() : window.$nuxt.$router.push('/'); + }); + break; - default: - ErrorMessageBox('', error); - break; + default: + ErrorMessageBox('', error); + break; + } } - } + }, 0) }; -- Gitblit v1.8.0