From fd661bd06bdacabbf55989e631a772e681d836fe Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 12 Oct 2020 11:04:24 +0800 Subject: [PATCH] =?UTF-8?q?header=20=E5=90=8E=E7=AB=AF=20cors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/utils/request.js | 2 +- server/server/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/utils/request.js b/client/src/utils/request.js index d4641f5..753f2a1 100644 --- a/client/src/utils/request.js +++ b/client/src/utils/request.js @@ -6,7 +6,7 @@ import { getToken } from '@/utils/auth' // create an axios instance const service = axios.create({ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url - // withCredentials: true, // send cookies when cross-domain requests + withCredentials: true, // send cookies when cross-domain requests timeout: 300000 // request timeout }) diff --git a/server/server/settings.py b/server/server/settings.py index 68edcbe..9d0a244 100644 --- a/server/server/settings.py +++ b/server/server/settings.py @@ -115,7 +115,7 @@ USE_L10N = True USE_TZ = True # 跨域配置 -CORS_ALLOW_CREDENTIALS = False +CORS_ALLOW_CREDENTIALS = True CORS_ORIGIN_ALLOW_ALL = True