401跳转等bug fix

This commit is contained in:
黄心宇 2024-05-24 09:08:06 +08:00
parent f1694e1752
commit 94f35892dc
2 changed files with 7 additions and 2 deletions

View File

@ -66,6 +66,11 @@ export function initAxiosInterceptors(props) {
return
}
const config = response.config;
if (response.data.status === 401) {
window.location.href = "/login"
}
if (response.data.status === -1) {
if (window.location.pathname.startsWith('/tasks/')) {
props.showSnackbar(response.data.message || '服务器异常,请联系管理员。')

View File

@ -355,7 +355,7 @@ export function TPMIndexHOC(WrappedComponent) {
hideNavPath = (path) => {
const hideUserPath = ['/statistics', '/projects', '/notice', '/organizes', '']
const hidePath = ['/nopage', '/403', '/500', '/organize/new', '/settings/profile']
const hidePath = ['/nopage', '/403', '/500', '/organize/new', '/settings']
let hide = false
const {current_user} = this.state;
hideUserPath.forEach(e => {
@ -364,7 +364,7 @@ export function TPMIndexHOC(WrappedComponent) {
}
})
hidePath.forEach(e => {
if (path === e) {
if (path.includes(e)) {
hide = true
}
})