Compare commits
2 Commits
9c1e923336
...
b76ef06c62
| Author | SHA1 | Date | |
|---|---|---|---|
|
b76ef06c62
|
|||
|
e5b391f7b7
|
@@ -67,14 +67,6 @@ function AdminLayout() {
|
|||||||
label: '用户资料',
|
label: '用户资料',
|
||||||
onClick: () => navigate('/admin/profile'),
|
onClick: () => navigate('/admin/profile'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
key: 'changePassword',
|
|
||||||
icon: <LockOutlined />,
|
|
||||||
label: '修改密码',
|
|
||||||
onClick: () => {
|
|
||||||
message.info('修改密码功能即将上线');
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: 'divider' as const,
|
type: 'divider' as const,
|
||||||
},
|
},
|
||||||
@@ -96,6 +88,15 @@ function AdminLayout() {
|
|||||||
return 'dashboard';
|
return 'dashboard';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getTitle = () => {
|
||||||
|
const path = location.pathname;
|
||||||
|
if (path.includes('/dashboard')) return '控制台';
|
||||||
|
if (path.includes('/generate')) return '生成二维码';
|
||||||
|
if (path.includes('/manage')) return '企业管理';
|
||||||
|
if (path.includes('/profile')) return '用户资料';
|
||||||
|
return '控制台';
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout className="admin-layout">
|
<Layout className="admin-layout">
|
||||||
<Sider
|
<Sider
|
||||||
@@ -117,7 +118,7 @@ function AdminLayout() {
|
|||||||
<Layout>
|
<Layout>
|
||||||
<Header className="admin-header">
|
<Header className="admin-header">
|
||||||
<div className="header-title">
|
<div className="header-title">
|
||||||
{menuItems.find((item) => item.key === getSelectedKey())?.label}
|
{getTitle()}
|
||||||
</div>
|
</div>
|
||||||
<div className="header-right">
|
<div className="header-right">
|
||||||
<Dropdown menu={{ items: userMenuItems }} placement="bottomRight">
|
<Dropdown menu={{ items: userMenuItems }} placement="bottomRight">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { Form, Input, Button, Card, message, Avatar, Descriptions, Space, Modal } from 'antd';
|
import { Form, Input, Button, Card, message, Avatar, Descriptions, Space, Modal, Row, Col } from 'antd';
|
||||||
import { UserOutlined, LockOutlined } from '@ant-design/icons';
|
import { UserOutlined, LockOutlined, SafetyOutlined, KeyOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||||
import { authApi } from '@/services/api';
|
import { authApi } from '@/services/api';
|
||||||
import type { User } from '@/types';
|
import type { User } from '@/types';
|
||||||
|
|
||||||
@@ -60,17 +60,19 @@ function ProfilePage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ maxWidth: '800px', margin: '0 auto' }}>
|
<div>
|
||||||
<Card
|
<Card
|
||||||
title={
|
title={
|
||||||
<span>
|
<span>
|
||||||
<UserOutlined /> 用户资料
|
<UserOutlined /> 用户资料
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
style={{ marginBottom: '24px' }}
|
bordered={false}
|
||||||
>
|
>
|
||||||
|
<Row gutter={24}>
|
||||||
|
<Col span={12}>
|
||||||
{user && (
|
{user && (
|
||||||
<Descriptions column={1} bordered style={{ marginBottom: '24px' }}>
|
<Descriptions column={1} bordered>
|
||||||
<Descriptions.Item label="头像">
|
<Descriptions.Item label="头像">
|
||||||
<Avatar icon={<UserOutlined />} size={64} />
|
<Avatar icon={<UserOutlined />} size={64} />
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
@@ -83,7 +85,12 @@ function ProfilePage() {
|
|||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
)}
|
)}
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={12}>
|
||||||
|
<div style={{ marginBottom: '16px', fontSize: '16px', fontWeight: 'bold' }}>
|
||||||
|
基础信息
|
||||||
|
</div>
|
||||||
<Form
|
<Form
|
||||||
form={profileForm}
|
form={profileForm}
|
||||||
onFinish={handleUpdateProfile}
|
onFinish={handleUpdateProfile}
|
||||||
@@ -116,20 +123,76 @@ function ProfilePage() {
|
|||||||
</Space>
|
</Space>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
|
||||||
|
|
||||||
|
<div style={{ marginTop: '24px', marginBottom: '16px', fontSize: '16px', fontWeight: 'bold' }}>
|
||||||
|
安全
|
||||||
|
</div>
|
||||||
<Card
|
<Card
|
||||||
title={
|
size="small"
|
||||||
<span>
|
bordered={false}
|
||||||
<LockOutlined /> 修改密码
|
style={{ backgroundColor: '#fafafa' }}
|
||||||
</span>
|
>
|
||||||
}
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||||
extra={
|
<Space>
|
||||||
|
<LockOutlined />
|
||||||
|
<span>修改密码</span>
|
||||||
|
</Space>
|
||||||
<Button type="primary" onClick={() => setPasswordModalVisible(true)}>
|
<Button type="primary" onClick={() => setPasswordModalVisible(true)}>
|
||||||
修改密码
|
修改密码
|
||||||
</Button>
|
</Button>
|
||||||
}
|
</div>
|
||||||
/>
|
</Card>
|
||||||
|
|
||||||
|
<Card
|
||||||
|
size="small"
|
||||||
|
bordered={false}
|
||||||
|
style={{ marginTop: '16px', backgroundColor: '#fafafa' }}
|
||||||
|
>
|
||||||
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||||
|
<Space>
|
||||||
|
<SafetyOutlined />
|
||||||
|
<span>双因素验证(TOTP)</span>
|
||||||
|
</Space>
|
||||||
|
<Button type="default">
|
||||||
|
启用
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card
|
||||||
|
size="small"
|
||||||
|
bordered={false}
|
||||||
|
style={{ marginTop: '16px', backgroundColor: '#fafafa' }}
|
||||||
|
>
|
||||||
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||||
|
<Space>
|
||||||
|
<KeyOutlined />
|
||||||
|
<span>通行密钥(Passkey)</span>
|
||||||
|
</Space>
|
||||||
|
<Button type="default">
|
||||||
|
启用
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card
|
||||||
|
size="small"
|
||||||
|
bordered={false}
|
||||||
|
style={{ marginTop: '16px', backgroundColor: '#fafafa' }}
|
||||||
|
>
|
||||||
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||||
|
<Space>
|
||||||
|
<ExclamationCircleOutlined />
|
||||||
|
<span>注销账户</span>
|
||||||
|
</Space>
|
||||||
|
<Button danger>
|
||||||
|
注销账户
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title="修改密码"
|
title="修改密码"
|
||||||
|
|||||||
Reference in New Issue
Block a user