feat: 群认证
This commit is contained in:
@ -4,6 +4,7 @@ import { AdminAPI } from '@/constants/api';
|
||||
import { EmployType, JobType } from '@/constants/job';
|
||||
import { request } from '@umijs/max';
|
||||
import { SortOrder } from 'antd/es/table/interface';
|
||||
import { buildUrl } from '@/services/utils';
|
||||
|
||||
function transformPageParams(params: API.PageParams & Record<string, any>) {
|
||||
params.page = params.current;
|
||||
@ -229,3 +230,71 @@ export async function updateDeclarationInfo(options: API.UpdateDeclarationParams
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function getStaffList(
|
||||
params: API.PageParams & Partial<API.StaffListItem>,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const result = await request<API.TableList<API.StaffListItem>>(AdminAPI.STAFF_LIST, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...transformPageParams(params),
|
||||
...(options || {}),
|
||||
},
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function getAllStaffList() {
|
||||
return await request<API.StaffListItem[]>(AdminAPI.STAFF_ALL, { method: 'GET' });
|
||||
}
|
||||
|
||||
export async function updateStaff(options: API.UpdateStaffParams) {
|
||||
return request(AdminAPI.STAFF_UPDATE, {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...(options || {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteStaff(id: number) {
|
||||
return request(buildUrl(AdminAPI.STAFF_DELETE, { id }), {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
export async function setDefaultStaff(id: number) {
|
||||
return request(buildUrl(AdminAPI.STAFF_SET_DEFAULT, { id }), {
|
||||
method: 'PUT',
|
||||
});
|
||||
}
|
||||
|
||||
export async function getCityOpratorList(
|
||||
params: API.PageParams & Partial<API.CityOperatorListItem>,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
const result = await request<API.TableList<API.CityOperatorListItem>>(AdminAPI.CITY_OPERATOR_LIST, {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...transformPageParams(params),
|
||||
...(options || {}),
|
||||
},
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function updateCityOperator(options: API.UpdateCityOperator) {
|
||||
return request<API.GroupListItem>(AdminAPI.CITY_OPERATOR_UPDATE, {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...(options || {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteCityOperator(id: number) {
|
||||
return request(buildUrl(AdminAPI.CITY_OPERATOR_DELETE, { id }), {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user