From e7a3ef970482360ecfe9341c04b6761d76c6bb49 Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Fri, 23 Dec 2022 12:12:29 +0800 Subject: [PATCH] cxw-010203 --- src/request/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/request/index.js b/src/request/index.js index b97ed80..2704455 100644 --- a/src/request/index.js +++ b/src/request/index.js @@ -24,6 +24,7 @@ function filterRequestData(obj) { //创建axios的实例 const httpService = axios.create({ baseURL: 'http://cloud.sws010.com',// TODO:具体的配置可以根据项目情况而来 + // withCredentials: true // timeout: 5000 }) @@ -32,7 +33,8 @@ httpService.interceptors.request.use(config => { // 请求成功处理 // if(localStorage.getItem('token')){//判断浏览器中的cookie中是否存在项目的token // config.headers.token = localStorage.getItem('token') - // } + // }\ + config.withCredentials = true; const rqParams = filterRequestData(config.params); const rqData = filterRequestData(config.data); // post 'Content-Type' === 'application/x-www-form-urlencoded'