From 2910e6ae2ebf7419022098c65154878c8ac73378 Mon Sep 17 00:00:00 2001 From: Link Date: Tue, 22 Dec 2020 18:00:06 +0800 Subject: [PATCH] fix: send cookies across origins --- src/utils/http.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/http.ts b/src/utils/http.ts index 006edacf..5a5c201d 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -11,13 +11,13 @@ const isDevelopment = getNodeEnv() === 'development' const baseURL = isDevelopment ? '' : VUE_APP_BUILD_BASE_URL const http: AxiosInstance = Axios.create({ + withCredentials: true, baseURL: baseURL, timeout: 20000 }) http.interceptors.request.use( config => { - config.headers.cookie = document.cookie return config }, error => {