|
@@ -1,36 +1,33 @@
|
|
|
-import { request } from '@umijs/max';
|
|
|
|
|
|
|
+import { postJson } from '@/request';
|
|
|
|
|
|
|
|
export async function fetchCreateUser(body: API.CreateUserReq) {
|
|
export async function fetchCreateUser(body: API.CreateUserReq) {
|
|
|
- return request<API.UserCreateResult>('/user/create', { method: 'POST', data: body });
|
|
|
|
|
|
|
+ return postJson<API.UserCreateResult>('/user/create', body);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export async function fetchUpdateUser(body: API.UpdateUserReq) {
|
|
export async function fetchUpdateUser(body: API.UpdateUserReq) {
|
|
|
- return request<API.Result>('/user/update', { method: 'POST', data: body });
|
|
|
|
|
|
|
+ return postJson<API.Result>('/user/update', body);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export async function fetchUserList(body: API.UserListReq) {
|
|
export async function fetchUserList(body: API.UserListReq) {
|
|
|
- return request<API.UserListResult>('/user/list', { method: 'POST', data: body });
|
|
|
|
|
|
|
+ return postJson<API.UserListResult>('/user/list', body);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export async function fetchUserDetail(body: API.UserDetailReq) {
|
|
export async function fetchUserDetail(body: API.UserDetailReq) {
|
|
|
- return request<API.UserDetailResult>('/user/detail', { method: 'POST', data: body });
|
|
|
|
|
|
|
+ return postJson<API.UserDetailResult>('/user/detail', body);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export async function fetchBindRoles(body: API.BindRolesReq) {
|
|
export async function fetchBindRoles(body: API.BindRolesReq) {
|
|
|
- return request<API.Result>('/user/bindRoles', { method: 'POST', data: body });
|
|
|
|
|
|
|
+ return postJson<API.Result>('/user/bindRoles', body);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export async function fetchSetUserPerms(body: API.SetUserPermsReq) {
|
|
export async function fetchSetUserPerms(body: API.SetUserPermsReq) {
|
|
|
- return request<API.Result>('/user/setPerms', { method: 'POST', data: body });
|
|
|
|
|
|
|
+ return postJson<API.Result>('/user/setPerms', body);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export async function fetchGetUserPerms(body: API.GetUserPermsReq) {
|
|
export async function fetchGetUserPerms(body: API.GetUserPermsReq) {
|
|
|
- return request<API.Result<API.GetUserPermsResp>>('/user/userPerms', {
|
|
|
|
|
- method: 'POST',
|
|
|
|
|
- data: body,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return postJson<API.Result<API.GetUserPermsResp>>('/user/userPerms', body);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export async function fetchUpdateUserStatus(body: API.UpdateUserStatusReq) {
|
|
export async function fetchUpdateUserStatus(body: API.UpdateUserStatusReq) {
|
|
|
- return request<API.Result>('/user/updateStatus', { method: 'POST', data: body });
|
|
|
|
|
|
|
+ return postJson<API.Result>('/user/updateStatus', body);
|
|
|
}
|
|
}
|