优化跳转

This commit is contained in:
黄心宇 2024-03-20 10:23:34 +08:00
parent 9965b1509a
commit 18c0b62361
1 changed files with 3 additions and 3 deletions

View File

@ -131,9 +131,7 @@ export function TPMIndexHOC(WrappedComponent) {
this.getComlist();
}
getComlist=()=>{
console.log(this.props.history.location);
getOrzCompanyList().then(res=>{
console.log(res);
if(res){
this.setState({
companyList:res.data.rows
@ -247,7 +245,9 @@ export function TPMIndexHOC(WrappedComponent) {
// 如果处于登录状态,且刚刚打开,那么跳到个人主页
// let hrefStr = this.props.match.path === "/login" || this.props.match.path === "/register" || this.props.match.path === "/resetPassword";
// console.log("111:",hrefStr,this.props.match.path);
if(this.props.match.path === "/"){
if(this.props.location.search.includes('path=organizes')) {
this.props.history.push(`/${response.data.login}/organizes`)
} else if(this.props.match.path === "/"){
this.props.history.push(`/${response.data.login}`)
}
if(!response.data.phone){