更新注册地址配置,修改注册跳转逻辑为使用REGISTER_URL

This commit is contained in:
linxd
2025-07-18 10:33:56 +08:00
parent 0af9171acd
commit 747cceeb18
4 changed files with 14 additions and 8 deletions

View File

@ -5,5 +5,7 @@ export default defineConfig({
define: {
UPLOAD_URL: '/upload',
REQUEST_BASE: '/api',
// 跳转注册地址 后面可追加 /expert (专家注册) /supplier (供应商注册)
REGISTER_URL: 'http://localhost:3002/register',
},
});

View File

@ -159,12 +159,13 @@ const IndexPage: React.FC<any> = ({ 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);
};

View File

@ -63,7 +63,8 @@ const LoginPage: React.FC<PageProps> = ({ 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');

2
src/typings.d.ts vendored
View File

@ -62,3 +62,5 @@ 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
// 注册地址
declare const REGISTER_URL: string