实现租户坐席账号管理

新增 /api/staff 列表/创建/更新/禁用,按租户坐席配额校验;系统设置增加坐席账号页支持增改禁与配额展示。
This commit is contained in:
yml2213
2026-07-15 14:07:06 +08:00
parent 34d3866520
commit ea3901d8b0
4 changed files with 696 additions and 16 deletions
+22
View File
@@ -223,6 +223,28 @@ export const getChannels = () => get<Channel[]>('/channels')
export const createChannel = (data: { type: string; name?: string }) => post<Channel>('/channels', data)
export const updateChannel = (id: number, data: { name?: string; status?: string }) => put<Channel>(`/channels/${id}`, data)
// 坐席账号
export interface StaffUser {
id: number
username: string
nickname: string
role: string
status: string
created_at: string
last_online_at?: string
}
export interface StaffListResult {
list: StaffUser[]
seat_limit: number
seat_used: number
}
export const getStaff = () => get<StaffListResult>('/staff')
export const createStaff = (data: { username: string; password: string; nickname?: string; role?: string }) =>
post<StaffUser>('/staff', data)
export const updateStaff = (id: number, data: { nickname?: string; role?: string; status?: string; password?: string }) =>
put<StaffUser>(`/staff/${id}`, data)
export const deleteStaff = (id: number) => del(`/staff/${id}`)
// Tenant settings
export type WorkHours = Record<string, string>
export interface TenantSettings {