v1.0.3 上线第一版
parent
c8b568bd5a
commit
8ebaddc866
|
|
@ -1,9 +1,16 @@
|
|||
/* UserManagement.css */
|
||||
.user-management .toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 1.5rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.user-management .toolbar h2 {
|
||||
margin: 0;
|
||||
flex-shrink: 0;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
.users-table {
|
||||
|
|
|
|||
|
|
@ -18,9 +18,11 @@ const UserManagement = () => {
|
|||
const [processingUser, setProcessingUser] = useState(null);
|
||||
const [newUser, setNewUser] = useState({ username: '', caption: '', email: '', role_id: 2 });
|
||||
const [editingUser, setEditingUser] = useState(null);
|
||||
const [roles, setRoles] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchUsers();
|
||||
fetchRoles();
|
||||
}, [page, pageSize]);
|
||||
|
||||
const fetchUsers = async () => {
|
||||
|
|
@ -36,6 +38,20 @@ const UserManagement = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const fetchRoles = async () => {
|
||||
try {
|
||||
const response = await apiClient.get(buildApiUrl(API_ENDPOINTS.USERS.ROLES));
|
||||
setRoles(response.data);
|
||||
} catch (err) {
|
||||
console.error('Error fetching roles:', err);
|
||||
// 如果无法获取角色列表,使用默认值
|
||||
setRoles([
|
||||
{ role_id: 1, role_name: '平台管理员' },
|
||||
{ role_id: 2, role_name: '普通用户' }
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
||||
const handleAddUser = async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
|
|
@ -141,7 +157,7 @@ const UserManagement = () => {
|
|||
<td>{user.username}</td>
|
||||
<td>{user.caption}</td>
|
||||
<td>{user.email}</td>
|
||||
<td>{user.role_id === 1 ? '管理员' : '普通用户'}</td>
|
||||
<td>{user.role_name}</td>
|
||||
<td>{new Date(user.created_at).toLocaleString()}</td>
|
||||
<td className="action-cell">
|
||||
<button className="action-btn" onClick={() => openEditModal(user)} title="修改"><Edit size={16} />修改</button>
|
||||
|
|
@ -184,8 +200,9 @@ const UserManagement = () => {
|
|||
<div className="form-group">
|
||||
<label>角色</label>
|
||||
<select className="form-input" value={newUser.role_id} onChange={(e) => setNewUser({...newUser, role_id: parseInt(e.target.value)})}>
|
||||
<option value={2}>普通用户</option>
|
||||
<option value={1}>管理员</option>
|
||||
{roles.map(role => (
|
||||
<option key={role.role_id} value={role.role_id}>{role.role_name}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div className="info-note">
|
||||
|
|
@ -221,8 +238,9 @@ const UserManagement = () => {
|
|||
<div className="form-group">
|
||||
<label>角色</label>
|
||||
<select className="form-input" value={editingUser.role_id} onChange={(e) => setEditingUser({...editingUser, role_id: parseInt(e.target.value)})}>
|
||||
<option value={2}>普通用户</option>
|
||||
<option value={1}>管理员</option>
|
||||
{roles.map(role => (
|
||||
<option key={role.role_id} value={role.role_id}>{role.role_name}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div className="modal-actions">
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ const API_CONFIG = {
|
|||
DELETE: (userId) => `/api/users/${userId}`,
|
||||
RESET_PASSWORD: (userId) => `/api/users/${userId}/reset-password`,
|
||||
DETAIL: (userId) => `/api/users/${userId}`,
|
||||
UPDATE_PASSWORD: (userId) => `/api/users/${userId}/password`
|
||||
UPDATE_PASSWORD: (userId) => `/api/users/${userId}/password`,
|
||||
ROLES: '/api/roles'
|
||||
},
|
||||
MEETINGS: {
|
||||
LIST: '/api/meetings',
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@
|
|||
transition: all 0.3s ease;
|
||||
font-weight: 500;
|
||||
outline: none;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.tab-btn:hover {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,9 @@ const CreateMeeting = ({ user }) => {
|
|||
|
||||
const fetchUsers = async () => {
|
||||
try {
|
||||
const response = await apiClient.get(buildApiUrl(API_ENDPOINTS.USERS.LIST));
|
||||
setAvailableUsers(response.data.filter(u => u.user_id !== user.user_id));
|
||||
// 获取所有用户,设置较大的size参数
|
||||
const response = await apiClient.get(buildApiUrl(`${API_ENDPOINTS.USERS.LIST}?page=1&size=1000`));
|
||||
setAvailableUsers(response.data.users.filter(u => u.user_id !== user.user_id));
|
||||
} catch (err) {
|
||||
console.error('Error fetching users:', err);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,9 @@
|
|||
}
|
||||
|
||||
.welcome-text {
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
color: #334155;
|
||||
font-weight: 600;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
|
|
@ -313,6 +314,14 @@
|
|||
align-items: center;
|
||||
cursor: pointer;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.user-menu-trigger:hover {
|
||||
background: #f1f5f9;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
|
|
|
|||
|
|
@ -681,5 +681,4 @@
|
|||
.modal-actions .btn-submit:disabled {
|
||||
opacity: 0.7;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
|
@ -68,8 +68,9 @@ const EditMeeting = ({ user }) => {
|
|||
|
||||
const fetchUsers = async () => {
|
||||
try {
|
||||
const response = await apiClient.get(buildApiUrl(API_ENDPOINTS.USERS.LIST));
|
||||
setAvailableUsers(response.data.filter(u => u.user_id !== user.user_id));
|
||||
// 获取所有用户,设置较大的size参数
|
||||
const response = await apiClient.get(buildApiUrl(`${API_ENDPOINTS.USERS.LIST}?page=1&size=1000`));
|
||||
setAvailableUsers(response.data.users.filter(u => u.user_id !== user.user_id));
|
||||
} catch (err) {
|
||||
console.error('Error fetching users:', err);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ const HomePage = ({ onLogin }) => {
|
|||
{/* Hero Section */}
|
||||
<section className="hero">
|
||||
<div className="hero-content">
|
||||
<h1 className="hero-title">智慧会议,让会议更高效</h1>
|
||||
<h1 className="hero-title">“慧会议” 让会议更高效</h1>
|
||||
<p className="hero-subtitle">
|
||||
通过AI技术,将会议音视频转化为结构化信息,提升团队协作效率
|
||||
通过AI将会议音频进行人声分离并自动总结,提升团队协作效率。
|
||||
</p>
|
||||
<button
|
||||
className="cta-button"
|
||||
|
|
|
|||
Loading…
Reference in New Issue