个人中心和工单接口

This commit is contained in:
mmc
2026-05-15 16:23:55 +08:00
parent 864368edfd
commit b18d293268
3 changed files with 99 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ import {
Divider,
Typography,
Space,
Radio,
} from 'antd';
import {
UserOutlined,
@@ -22,6 +23,8 @@ import {
MailOutlined,
SafetyOutlined,
EditOutlined,
ManOutlined,
WomanOutlined,
} from '@ant-design/icons';
import { useSelector } from 'react-redux';
import { RootState, useAppDispatch } from '../store';
@@ -59,7 +62,12 @@ const Profile: React.FC = () => {
const handleUpdateProfile = async (values: any) => {
setLoading(true);
try {
const res: any = await updateUserProfile(values);
// 构建完整的个人信息对象,包含用户 ID 等必要字段
const updateData = {
...profileData,
...values,
};
const res: any = await updateUserProfile(updateData);
if (res.code === 200) {
message.success('修改成功');
const newUserInfo = { ...userInfo, ...values };
@@ -232,6 +240,17 @@ const Profile: React.FC = () => {
initialValues={profileData}
size="large"
>
<Form.Item
label="用户名称"
name="userName"
>
<Input
prefix={<UserOutlined />}
disabled
style={{ borderRadius: 6 }}
/>
</Form.Item>
<Form.Item
label="用户昵称"
name="nickName"
@@ -244,6 +263,16 @@ const Profile: React.FC = () => {
/>
</Form.Item>
<Form.Item
label="性别"
name="sex"
>
<Radio.Group>
<Radio value="0"><ManOutlined /> 男</Radio>
<Radio value="1"><WomanOutlined /> 女</Radio>
</Radio.Group>
</Form.Item>
<Form.Item
label="手机号码"
name="phonenumber"
@@ -268,6 +297,17 @@ const Profile: React.FC = () => {
/>
</Form.Item>
<Form.Item
label="备注"
name="remark"
>
<Input.TextArea
placeholder="请输入备注"
style={{ borderRadius: 6 }}
rows={3}
/>
</Form.Item>
<Form.Item style={{ marginTop: 28 }}>
<Button
type="primary"