From 965db8f11b4ce3df0c0604cc5f008d42aa6db7d4 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期六, 05 八月 2023 18:06:43 +0800 Subject: [PATCH] Fixed: [弱掃] p19.1 Bad use of null-like value --- PAMapp/shared/services/httpClient.ts | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/PAMapp/shared/services/httpClient.ts b/PAMapp/shared/services/httpClient.ts index c0b08f2..a015cd1 100644 --- a/PAMapp/shared/services/httpClient.ts +++ b/PAMapp/shared/services/httpClient.ts @@ -10,11 +10,14 @@ '/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; @@ -48,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' } } -- Gitblit v1.8.0