401跳转等bug fix
This commit is contained in:
parent
f1694e1752
commit
94f35892dc
|
|
@ -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 || '服务器异常,请联系管理员。')
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue