fix: align permission-gated UI actions
This commit is contained in:
@@ -4,7 +4,7 @@ import { Form, Input, Button, Card, Typography } from 'antd';
|
||||
import { UserOutlined, LockOutlined } from '@ant-design/icons';
|
||||
import api from '../../api';
|
||||
import { message } from '../../ui/app-message';
|
||||
import { writePermissions } from '../../auth/permission-store';
|
||||
import { clearPermissions, writePermissions } from '../../auth/permission-store';
|
||||
import { findRoleAwareLandingPath } from '../../auth/menu-policy';
|
||||
|
||||
const { Title } = Typography;
|
||||
@@ -15,6 +15,7 @@ const LoginPage: React.FC = () => {
|
||||
|
||||
const onFinish = useCallback(
|
||||
async (values: any) => {
|
||||
clearPermissions();
|
||||
setLoading(true);
|
||||
try {
|
||||
const res: any = await api.post('/auth/login', values);
|
||||
@@ -66,11 +67,7 @@ const LoginPage: React.FC = () => {
|
||||
name="username"
|
||||
rules={[{ required: true, message: '请输入用户名' }]}
|
||||
>
|
||||
<Input
|
||||
prefix={<UserOutlined />}
|
||||
placeholder="用户名"
|
||||
autoComplete="username"
|
||||
/>
|
||||
<Input prefix={<UserOutlined />} placeholder="用户名" autoComplete="username" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="密码"
|
||||
|
||||
Reference in New Issue
Block a user