mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 06:46:40 +08:00
feat: Switch the login page to the registration component by changing the routing parameters #3221 (#3307)
### What problem does this PR solve? feat: Switch the login page to the registration component by changing the routing parameters #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
19
web/src/pages/login-next/hooks.ts
Normal file
19
web/src/pages/login-next/hooks.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useSearchParams } from 'umi';
|
||||
|
||||
export enum Step {
|
||||
SignIn,
|
||||
SignUp,
|
||||
ForgotPassword,
|
||||
ResetPassword,
|
||||
VerifyEmail,
|
||||
}
|
||||
|
||||
export const useSwitchStep = (step: Step) => {
|
||||
const [_, setSearchParams] = useSearchParams();
|
||||
const switchStep = useCallback(() => {
|
||||
setSearchParams(new URLSearchParams({ step: step.toString() }));
|
||||
}, [setSearchParams, step]);
|
||||
|
||||
return { switchStep };
|
||||
};
|
||||
Reference in New Issue
Block a user