From f065760fa7df1f88747395ab4b55349ce8b2faf0 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期一, 25 十二月 2023 13:35:43 +0800 Subject: [PATCH] Update#178944: 移除 lodash 套件 --- PAMapp/shared/services/httpClient.ts | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/PAMapp/shared/services/httpClient.ts b/PAMapp/shared/services/httpClient.ts index 08a5b6e..8fe7bad 100644 --- a/PAMapp/shared/services/httpClient.ts +++ b/PAMapp/shared/services/httpClient.ts @@ -1,6 +1,4 @@ -import { AxiosRequestConfig, AxiosError, AxiosResponse} from 'axios'; -import axios from 'axios'; -import _ from 'lodash'; +import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; import messageBoxService from './message-box.service'; @@ -86,11 +84,15 @@ messageBoxService.showErrorMessage('', error); return } - if (!_.includes(notRequireInterceptorErrorUrl, error.config.url)) { + if (!notRequireInterceptorErrorUrl.includes(error.config.url)) { switch (error.response.status) { case 401: Promise.all([messageBoxService.showErrorMessage('���暹��'), window.$nuxt.$store.dispatch('localStorage/actionStorageClear')]).then(() => { - _.isEqual(window.$nuxt.$route.name, 'index') ? location.reload() : window.$nuxt.$router.push('/'); + if (window.$nuxt.$route.name === 'index') { + location.reload(); + } else { + window.$nuxt.$router.push('/'); + } }); break; -- Gitblit v1.8.0