|
|
@@ -2,8 +2,9 @@ import React, { useState, useEffect } from 'react';
|
|
|
import { useAuth } from '../hooks/AuthProvider';
|
|
|
import { useNavigate } from 'react-router-dom';
|
|
|
import { silverUsersClient } from '@/client/api';
|
|
|
-import { App, Card, List, Button, Tag, Modal, Form, Input, Select, Upload, message } from 'antd';
|
|
|
+import { App, Card, List, Button, Tag, Modal, Form, Input, Select, Upload } from 'antd';
|
|
|
import { PlusOutlined, UploadOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
|
|
|
+import { toast } from 'react-toastify';
|
|
|
import type { UploadProps } from 'antd';
|
|
|
|
|
|
const { Option } = Select;
|
|
|
@@ -11,7 +12,6 @@ const { Option } = Select;
|
|
|
const SkillsPage: React.FC = () => {
|
|
|
const { user } = useAuth();
|
|
|
const navigate = useNavigate();
|
|
|
- const { message } = App.useApp();
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
const [skills, setSkills] = useState<any[]>([]);
|
|
|
const [certificates, setCertificates] = useState<any[]>([]);
|
|
|
@@ -44,7 +44,7 @@ const SkillsPage: React.FC = () => {
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('加载技能信息失败:', error);
|
|
|
- message.error('加载技能信息失败');
|
|
|
+ toast.error('加载技能信息失败');
|
|
|
} finally {
|
|
|
setLoading(false);
|
|
|
}
|
|
|
@@ -55,9 +55,9 @@ const SkillsPage: React.FC = () => {
|
|
|
const newSkills = [...skills, values.skill];
|
|
|
await updateProfile({ skills: newSkills.join(',') });
|
|
|
setSkills(newSkills);
|
|
|
- message.success('技能添加成功');
|
|
|
+ toast.success('技能添加成功');
|
|
|
} catch (error) {
|
|
|
- message.error('技能添加失败');
|
|
|
+ toast.error('技能添加失败');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -66,9 +66,9 @@ const SkillsPage: React.FC = () => {
|
|
|
const newSkills = skills.filter(skill => skill !== skillToRemove);
|
|
|
await updateProfile({ skills: newSkills.join(',') });
|
|
|
setSkills(newSkills);
|
|
|
- message.success('技能删除成功');
|
|
|
+ toast.success('技能删除成功');
|
|
|
} catch (error) {
|
|
|
- message.error('技能删除失败');
|
|
|
+ toast.error('技能删除失败');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -79,7 +79,7 @@ const SkillsPage: React.FC = () => {
|
|
|
setCertificates(newCertificates);
|
|
|
message.success('证书添加成功');
|
|
|
} catch (error) {
|
|
|
- message.error('证书添加失败');
|
|
|
+ toast.error('证书添加失败');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -90,7 +90,7 @@ const SkillsPage: React.FC = () => {
|
|
|
setCertificates(newCertificates);
|
|
|
message.success('证书删除成功');
|
|
|
} catch (error) {
|
|
|
- message.error('证书删除失败');
|
|
|
+ toast.error('证书删除失败');
|
|
|
}
|
|
|
};
|
|
|
|