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