重构整个项目
This commit is contained in:
@@ -57,24 +57,39 @@ export const ticketApi = {
|
||||
}
|
||||
|
||||
export const customerApi = {
|
||||
getCustomers() {
|
||||
return adminRequest.get('/customers')
|
||||
},
|
||||
|
||||
// 添加客户,data 结构应为 { company_name: 'xxx' }
|
||||
addCustomerName(data) {
|
||||
return adminRequest.post('/addcustomername', data)
|
||||
addCompany(data) {
|
||||
return adminRequest.post('/addCompany', data)
|
||||
},
|
||||
|
||||
addEmployee(data) {
|
||||
return adminRequest.post('/addemployee', data)
|
||||
addOperator(data) {
|
||||
return adminRequest.post('/addOperator', data)
|
||||
},
|
||||
|
||||
deleteEmployee(empId) {
|
||||
return adminRequest.delete(`/deleteemployee/${empId}`)
|
||||
deleteOperator(operatorId) { // 已修改
|
||||
return adminRequest.delete(`/deleteoperator/${operatorId}`)
|
||||
},
|
||||
|
||||
deleteCustomer(customerId) {
|
||||
return adminRequest.delete(`/deletecustomer/${customerId}`)
|
||||
deleteCompany(CompanyId) { // 已修改
|
||||
return adminRequest.delete(`/deletecompany/${CompanyId}`)
|
||||
}
|
||||
}
|
||||
|
||||
export const accountApi = {
|
||||
getAllUsers() {
|
||||
return adminRequest.get('/getAllUsers')
|
||||
},
|
||||
|
||||
addAccount(data) {
|
||||
return adminRequest.post('/addAccount', data)
|
||||
},
|
||||
|
||||
updateAccountStatus(id, status) {
|
||||
return adminRequest.put(`/account/${id}/status`, { status })
|
||||
},
|
||||
|
||||
deleteAccount(id) {
|
||||
return adminRequest.delete(`/account/${id}`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user