From 747cceeb18d36061e483a4f5b7b473d2dd77d485 Mon Sep 17 00:00:00 2001 From: linxd <544554903@qq.com> Date: Fri, 18 Jul 2025 10:33:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=A8=E5=86=8C=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E9=85=8D=E7=BD=AE=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91=E4=B8=BA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8REGISTER=5FURL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.dev.ts | 2 ++ src/pages/index/index.tsx | 13 +++++++------ src/pages/login/login.tsx | 3 ++- src/typings.d.ts | 4 +++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/config/config.dev.ts b/config/config.dev.ts index 93fd3d8..54ab293 100644 --- a/config/config.dev.ts +++ b/config/config.dev.ts @@ -5,5 +5,7 @@ export default defineConfig({ define: { UPLOAD_URL: '/upload', REQUEST_BASE: '/api', + // 跳转注册地址 后面可追加 /expert (专家注册) /supplier (供应商注册) + REGISTER_URL: 'http://localhost:3002/register', }, }); diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 7e6c371..153533f 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -159,12 +159,13 @@ const IndexPage: React.FC = ({ user }) => { }; const toRegister = (type: string) => { - history.push({ - pathname: '/register/supplier', - query: { - type: type, - }, - }); + window.location.href = `${REGISTER_URL}/${type}?redirect=${encodeURIComponent(window.location.href)}`; + // history.push({ + // pathname: '/register/supplier', + // query: { + // type: type, + // }, + // }); console.log(type); }; diff --git a/src/pages/login/login.tsx b/src/pages/login/login.tsx index f35f2ec..6dbfdfc 100644 --- a/src/pages/login/login.tsx +++ b/src/pages/login/login.tsx @@ -63,7 +63,8 @@ const LoginPage: React.FC = ({ user, dispatch }) => { const handleRegister = () => { switch (activeKey) { case 'supplier': - history.push('/register/supplier'); + window.location.href = `${REGISTER_URL}/${activeKey}?redirect=${encodeURIComponent(window.location.href)}`; + // history.push('/register/supplier'); break; case 'expert': history.push('/register/expert'); diff --git a/src/typings.d.ts b/src/typings.d.ts index c9091a9..ef18232 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -61,4 +61,6 @@ declare const REACT_APP_CUSTOMERSERVICE_USERCENTER: string declare const REACT_APP_CUSTOMERSERVICE_CLIENT_ID: string declare const REACT_APP_CUSTOMERSERVICE_REDIRECT: string declare const UPLOAD_URL: string -declare const REQUEST_BASE: string \ No newline at end of file +declare const REQUEST_BASE: string +// 注册地址 +declare const REGISTER_URL: string