保誠-保戶業務員媒合平台
Tomas
2021-12-15 f911dede83e941f81c0ab91378b74639596815ee
fixed#132444 - 顧問細節資訊,如 refresh 會出現 property of undefined 的錯
修改1個檔案
32 ■■■■■ 已變更過的檔案
PAMapp/assets/ts/services/httpClient.ts 32 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
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)
};