Skip to content

Commit beed69e

Browse files
committed
feat: 优化登录的hook
1 parent d968843 commit beed69e

File tree

2 files changed

+2
-53
lines changed

2 files changed

+2
-53
lines changed

src/pages/(blank)/login/hook.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/pages/(blank)/login/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { Button, Checkbox, Divider, Input, Space } from 'antd';
22

33
import { loginModuleRecord } from '@/constants/app';
4+
import { useInitAuth } from '@/features/auth/initAuth';
45
import { SubmitEnterButton, useFormRules } from '@/features/form';
56

6-
import { useLogin } from './hook';
7-
87
type AccountKey = 'admin' | 'super' | 'user';
98
interface Account {
109
key: AccountKey;
@@ -23,7 +22,7 @@ const INITIAL_VALUES = {
2322
const PwdLogin = () => {
2423
const { t } = useTranslation();
2524

26-
const { loading, toLogin } = useLogin();
25+
const { loading, toLogin } = useInitAuth();
2726

2827
const [form] = AForm.useForm<LoginParams>();
2928

0 commit comments

Comments
 (0)