From a6126fc2161d523e2bf193743bcea78d6a76745a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 31 Dec 2019 18:11:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 5 +++-- public/react/src/common/UrlTool.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 0ab212134..4f8d5988c 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,7 +42,7 @@ if (isDev) { // 老师 //ebugType="teacher"; // 学生 -debugType="student"; +//debugType="student"; function railsgettimes(proxy) { @@ -94,9 +94,10 @@ export function initAxiosInterceptors(props) { requestMap[keyName] = false; } + axios.interceptors.request.use( config => { - + config.headers['Content-Type']= 'no-cache' // if (token) { // 每次发送请求之前判断是否存在token,如果存在,则统一在http请求的header都加上token,不用每次请求都手动添加了 // config.headers.Authorization = token; // } diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js index 33a84dc55..8c3317cf6 100644 --- a/public/react/src/common/UrlTool.js +++ b/public/react/src/common/UrlTool.js @@ -128,7 +128,7 @@ export function getTaskUrlById(id) { export function getRandomcode(url) { Railsgettimes() let anewopens=md5(newopens+newtimestamp); - return `${url}?&randomcode=${newtimestamp}&client_key=${anewopens}` + return `${url}?randomcode=${newtimestamp}&client_key=${anewopens}` } export function htmlEncode(str) {