更新注册地址配置,修改注册跳转逻辑为使用REGISTER_URL
This commit is contained in:
@ -5,5 +5,7 @@ export default defineConfig({
|
||||
define: {
|
||||
UPLOAD_URL: '/upload',
|
||||
REQUEST_BASE: '/api',
|
||||
// 跳转注册地址 后面可追加 /expert (专家注册) /supplier (供应商注册)
|
||||
REGISTER_URL: 'http://localhost:3002/register',
|
||||
},
|
||||
});
|
||||
|
@ -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);
|
||||
};
|
||||
|
||||
|
@ -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');
|
||||
|
4
src/typings.d.ts
vendored
4
src/typings.d.ts
vendored
@ -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
|
||||
declare const REQUEST_BASE: string
|
||||
// 注册地址
|
||||
declare const REGISTER_URL: string
|
||||
|
Reference in New Issue
Block a user