This commit is contained in:
Chuck1sn
2025-05-14 10:16:48 +08:00
commit 3cd59337e7
220 changed files with 23768 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import client from "@/api/client";
export function useDepartmentBind() {
const bindDepartment = async (userId: number, departmentIds: number[]) => {
try {
await client.POST("/iam/department/bind", {
body: {
userId,
departmentIds,
},
});
return true;
} catch (error) {
console.error("Error binding departments:", error);
return false;
}
};
const unbindDepartment = async (userId: number, departmentIds: number[]) => {
try {
await client.POST("/iam/department/unbind", {
body: {
userId,
departmentIds,
},
});
return true;
} catch (error) {
console.error("Error unbinding departments:", error);
return false;
}
};
return {
bindDepartment,
unbindDepartment,
};
}