有已开通的工作台,登录后跳转到第一个工作台
This commit is contained in:
parent
03463ce3c4
commit
9732624e43
|
@ -10,6 +10,7 @@ import axios from 'axios';
|
||||||
import cookie from 'react-cookies';
|
import cookie from 'react-cookies';
|
||||||
import './LoginRegisterPageNew.scss';
|
import './LoginRegisterPageNew.scss';
|
||||||
import { Encrypt } from "../../common/Env";
|
import { Encrypt } from "../../common/Env";
|
||||||
|
import { getOrzCompanyList } from "../../forge/Information/api";
|
||||||
|
|
||||||
function Login(props){
|
function Login(props){
|
||||||
const [message,setMessage] = useState();
|
const [message,setMessage] = useState();
|
||||||
|
@ -51,11 +52,23 @@ function Login(props){
|
||||||
cookie.save('autologin',values.remember);
|
cookie.save('autologin',values.remember);
|
||||||
cookie.save('supplyphone',true);
|
cookie.save('supplyphone',true);
|
||||||
cookie.save("login",response.data.login);
|
cookie.save("login",response.data.login);
|
||||||
|
//意见反馈
|
||||||
const searchParams = new URLSearchParams(search.substring(1));
|
const searchParams = new URLSearchParams(search.substring(1));
|
||||||
const goPage = searchParams.get("go_page");
|
const goPage = searchParams.get("go_page");
|
||||||
//意见反馈
|
// 获取工作台,如果有已开通的工作台,则跳转到第一个工作台
|
||||||
window.location.href = goPage ? goPage : `/${response.data.login}`
|
if(goPage){
|
||||||
|
window.location.href = goPage
|
||||||
|
}else{
|
||||||
|
getOrzCompanyList().then(res=>{
|
||||||
|
if(res && res.data && res.data.rows && res.data.rows[0]){
|
||||||
|
window.location.href = `${ mygetHelmetapi && mygetHelmetapi.common.zone }/${res.data.rows[0].enterpriseIdentifier}`
|
||||||
|
}else{
|
||||||
|
window.location.href = `/${response.data.login}`
|
||||||
|
}
|
||||||
|
}).catch(()=>{
|
||||||
|
window.location.href = `/${response.data.login}`
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log('error',error);
|
console.log('error',error);
|
||||||
|
|
Loading…
Reference in New Issue