请求异步导致页面跳转异常

This commit is contained in:
谢思 2023-12-18 13:57:28 +08:00
parent 42975ca188
commit 219842be69
2 changed files with 13 additions and 13 deletions

View File

@ -43,19 +43,18 @@ export function initAxiosInterceptors(props) {
requestProxy(config);
let url = `/api${config.url}`;
// if (`${config[0]}` !== `true`) {
// if (window.location.port === "3007") {
// config.url = `${proxy}${url}`;
// if (config.url.indexOf('?') === -1) {
// config.url = `${config.url}`;
// } else {
// config.url = `${config.url}`;
// }
// } else {
// config.url = url;
// }
// }
config.url = url;
if (`${config[0]}` !== `true`) {
if (window.location.port === "3007") {
config.url = `${proxy}${url}`;
if (config.url.indexOf('?') === -1) {
config.url = `${config.url}?debug=${debugType}`;
} else {
config.url = `${config.url}&debug=${debugType}`;
}
} else {
config.url = url;
}
}
config.withCredentials = false;
return config;
},

View File

@ -101,6 +101,7 @@ export default (props) => {
...firstWiki,
key: firstWikiNode.key
})
if(window.location.pathname.indexOf('/wiki') === -1) return
history.push(`/${owner}/${projectsId}/wiki/${title}/${firstWikiNode.key}`);
} else {
setFileArr([]);