From 6efe7c6f97e5e891285c2f4cf10c8272a86ad551 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期六, 05 八月 2023 17:23:14 +0800
Subject: [PATCH] Fixed: [弱掃] p12.1 URL manipulation

---
 PAMapp/shared/services/httpClient.ts |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/PAMapp/shared/services/httpClient.ts b/PAMapp/shared/services/httpClient.ts
index 46171ec..a015cd1 100644
--- a/PAMapp/shared/services/httpClient.ts
+++ b/PAMapp/shared/services/httpClient.ts
@@ -6,14 +6,18 @@
 
 const notRequireInterceptorErrorUrl = [
   '/otp/verify',
+  // '/otp/sendOtp',
   '/eService/authenticate',
   '/login/validate/get_img_code',
   '/login/validate/verify_img_code',
+  '/api/access_analysis/insert'
 ];
 
+const BASE_URL = process.env.BASE_URL;
+
 export const http = axios.create({
-  baseURL: process.env.BASE_URL,
-  withCredentials: true
+  baseURL: BASE_URL,
+  withCredentials: true,
 });
 
 let apiNumber = 0;
@@ -47,7 +51,8 @@
 
 function addHttpHeader(config: AxiosRequestConfig): void {
   config.headers = {
-    Authorization: 'Bearer ' + localStorage.getItem('id_token')
+    Authorization: 'Bearer ' + localStorage.getItem('id_token'),
+    'content-type': 'application/json'
   }
 }
 
@@ -65,6 +70,12 @@
 
 function showErrorMessageBox(error: any): void {
   setTimeout(() => {
+    // NOTE: 甇斤 HOT FIX 憿批��憭望������暹��� dialog [Tomas, 2022/7/20 14:21]
+    if(error.config.url.includes('/eService/authenticate')) return;
+    if (error.config.url.includes('/otp/sendOtp')) {
+      messageBoxService.showErrorMessage('', error);
+      return
+    }
     if (!_.includes(notRequireInterceptorErrorUrl, error.config.url)) {
       switch (error.response.status) {
         case 401:

--
Gitblit v1.8.0