From 9732624e4338a1c7e7e860ddd69fca55de98c52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Wed, 19 Feb 2025 15:03:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E5=B7=B2=E5=BC=80=E9=80=9A=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0,=E7=99=BB=E5=BD=95=E5=90=8E?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/loginRegister/LoginNew.jsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/modules/loginRegister/LoginNew.jsx b/src/modules/loginRegister/LoginNew.jsx index 1cc5ee36e..5632758ea 100644 --- a/src/modules/loginRegister/LoginNew.jsx +++ b/src/modules/loginRegister/LoginNew.jsx @@ -10,6 +10,7 @@ import axios from 'axios'; import cookie from 'react-cookies'; import './LoginRegisterPageNew.scss'; import { Encrypt } from "../../common/Env"; +import { getOrzCompanyList } from "../../forge/Information/api"; function Login(props){ const [message,setMessage] = useState(); @@ -51,11 +52,23 @@ function Login(props){ cookie.save('autologin',values.remember); cookie.save('supplyphone',true); cookie.save("login",response.data.login); - + //意见反馈 const searchParams = new URLSearchParams(search.substring(1)); 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) => { console.log('error',error);