From d28631e667a72c8c997aa3ce2692ebf5616b6695 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 9 Oct 2024 15:15:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(axios):=20=E5=A2=9E=E5=8A=A0=E5=89=8D?= =?UTF-8?q?=E7=AB=AFhttp=E8=AF=B7=E6=B1=82=E5=A4=B4=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/vue/src/utils/http/axios/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/vue/src/utils/http/axios/index.ts b/apps/vue/src/utils/http/axios/index.ts index 56bf43550..c49e6ecb3 100644 --- a/apps/vue/src/utils/http/axios/index.ts +++ b/apps/vue/src/utils/http/axios/index.ts @@ -186,7 +186,11 @@ function createAxios(opt?: Partial) { // 基础接口地址 // baseURL: globSetting.apiUrl, - headers: { 'Content-Type': ContentTypeEnum.JSON }, + headers: { + 'Content-Type': ContentTypeEnum.JSON, + // 取消后端cookie重定向 + 'X-Request-From': 'vben', + }, // 如果是form-data格式 // headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED }, // 数据处理方式