update user detail

This commit is contained in:
Timi
2026-08-07 16:02:29 +08:00
parent 1b1121f052
commit 28b789eb86
13 changed files with 421 additions and 147 deletions
+25 -1
View File
@@ -4,7 +4,26 @@ import { withCurrentStoreId, withCurrentStorePage } from "@/utils/store";
const BASE_URI = "/gao/user";
async function list(page: Page<ManagedUser>): Promise<PageResult<ManagedUser>> {
type ListOptions = {
allStores?: boolean;
storeId?: string;
};
async function list(page: Page<ManagedUser>, options?: ListOptions): Promise<PageResult<ManagedUser>> {
if (options?.allStores) {
return await axios.post(`${BASE_URI}/list`, page);
}
if (options?.storeId) {
return await axios.post(`${BASE_URI}/list`, {
...page,
equalsExample: {
...(page.equalsExample || {}),
storeId: options.storeId
}
});
}
return await axios.post(`${BASE_URI}/list`, withCurrentStorePage(page));
}
@@ -22,6 +41,10 @@ async function update(user: ManagedUser): Promise<ManagedUser> {
return await axios.post(`${BASE_URI}/update`, withCurrentStoreId(user));
}
async function transferStore(user: ManagedUser): Promise<ManagedUser> {
return await axios.post(`${BASE_URI}/transfer/store`, user);
}
async function remove(id: string): Promise<void> {
return await axios.post(`${BASE_URI}/delete`, undefined, {
params: { id }
@@ -37,6 +60,7 @@ export default {
detail,
create,
update,
transferStore,
remove,
roleList
};
+5
View File
@@ -14,6 +14,10 @@ async function detail(id: string): Promise<Store> {
});
}
async function loginStore(): Promise<Store> {
return await axios.post(`${STORE_BASE_URI}/user`);
}
async function create(store: Store): Promise<string> {
return await axios.post(`${STORE_BASE_URI}/create`, store);
}
@@ -75,6 +79,7 @@ async function removeBusinessDay(id: string): Promise<void> {
export default {
list,
detail,
loginStore,
create,
update,
sort,