提交 6f635fdb authored 作者: 钟是志's avatar 钟是志

代码优化

上级 1219b371
......@@ -45,7 +45,8 @@ const queryConfig = (key) => {
if (dynamicConfig[key] &&
typeof dynamicConfig[key] === 'string' &&
process.env.NODE_ENV === 'development' &&
window.location.href.indexOf('onestopmobile') <= -1
window.location.href.indexOf('onestopmobile') <= -1 &&
window.location.href.indexOf('jyPortal') <= -1
) {
let url = dynamicConfig[key];
url = url.replace('https://yx.bpi.edu.cn/produce', window.location.origin + '/produce');
......
......@@ -206,7 +206,7 @@ export default function request(
return response.json();
})
.then(response => {
if (typeof response == 'string') {
if (typeof response === 'string') {
try {
const xxx = JSON.parse(response);
if (xxx.status === 404) {
......@@ -234,6 +234,7 @@ export default function request(
const status = e.name;
if (status === 401) { // 401直接清空token
delToken();
if (window.top != window.self) {
window.top.postMessage('returnLogin', '*'); // Iframe 返回登录页
return true;
......
......@@ -77,7 +77,7 @@ export function getHeaders(url = '') {
},
};
console.log(url);
if (getIsBei_Dian() && userId && window.location.href.indexOf('/onestop') <= -1) {
if (getIsBei_Dian() && userId && window.location.href.indexOf('/onestop') <= -1 && url.indexOf('/onestop') <= -1) {
res.headers.auth = gg5xxxxx(secretString);
res.headers.timestamp = timestamp;
if (isTest) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论