This commit is contained in:
xiaojunnuo
2024-09-23 13:23:49 +08:00
parent e0466409d0
commit 8e03e8463f
10 changed files with 86 additions and 56 deletions
@@ -1,9 +1,25 @@
import { request } from "/@/api/service";
export function PreBindUser(userId: number) {
request({
export async function PreBindUser(userId: number) {
await request({
url: "/sys/account/preBindUser",
method: "post",
data: { userId }
});
}
export async function BindUser(userId: number) {
await request({
url: "/sys/account/bindUser",
method: "post",
data: { userId }
});
}
export async function UnbindUser(userId: number) {
await request({
url: "/sys/account/unbindUser",
method: "post",
data: { userId }
});
}
@@ -32,10 +32,21 @@ onMounted(() => {
return subjectInfo;
});
iframeClient.register("preBindSubject", async (req) => {
let preBindUserId = null;
iframeClient.register("preBindUser", async (req) => {
const userId = req.data.userId;
preBindUserId = userId;
await api.PreBindUser(userId);
});
iframeClient.register("onBoundUser", async (req) => {
await api.BindUser(preBindUserId);
});
iframeClient.register("unbindUser", async (req) => {
const userId = req.data.userId;
await api.UnbindUser(userId);
});
});
</script>
@@ -1,7 +1,7 @@
import { request } from "/src/api/service";
const apiPrefix = "/sys/authority/permission";
export async function GetList(query: any) {
return request({
return await request({
url: apiPrefix + "/page",
method: "post",
data: query
@@ -9,14 +9,14 @@ export async function GetList(query: any) {
}
export async function GetTree() {
return request({
return await request({
url: apiPrefix + "/tree",
method: "post"
});
}
export async function AddObj(obj: any) {
return request({
return await request({
url: apiPrefix + "/add",
method: "post",
data: obj
@@ -24,7 +24,7 @@ export async function AddObj(obj: any) {
}
export async function UpdateObj(obj: any) {
return request({
return await request({
url: apiPrefix + "/update",
method: "post",
data: obj
@@ -32,7 +32,7 @@ export async function UpdateObj(obj: any) {
}
export async function DelObj(id: any) {
return request({
return await request({
url: apiPrefix + "/delete",
method: "post",
params: { id }
@@ -40,7 +40,7 @@ export async function DelObj(id: any) {
}
export async function GetObj(id: any) {
return request({
return await request({
url: apiPrefix + "/info",
method: "post",
params: { id }
@@ -1,7 +1,7 @@
import { request } from "/src/api/service";
const apiPrefix = "/sys/authority/role";
export async function GetList(query: any) {
return request({
return await request({
url: apiPrefix + "/page",
method: "post",
data: query
@@ -9,7 +9,7 @@ export async function GetList(query: any) {
}
export async function AddObj(obj: any) {
return request({
return await request({
url: apiPrefix + "/add",
method: "post",
data: obj
@@ -17,7 +17,7 @@ export async function AddObj(obj: any) {
}
export async function UpdateObj(obj: any) {
return request({
return await request({
url: apiPrefix + "/update",
method: "post",
data: obj
@@ -25,7 +25,7 @@ export async function UpdateObj(obj: any) {
}
export async function DelObj(id: any) {
return request({
return await request({
url: apiPrefix + "/delete",
method: "post",
params: { id }
@@ -33,7 +33,7 @@ export async function DelObj(id: any) {
}
export async function GetObj(id: any) {
return request({
return await request({
url: apiPrefix + "/info",
method: "post",
params: { id }
@@ -47,7 +47,7 @@ export async function GetObj(id: any) {
* @constructor
*/
export function getPermissionIds(roleId: any) {
return request({
return await request({
url: apiPrefix + "/getPermissionIds",
method: "post",
params: { id: roleId }
@@ -62,7 +62,7 @@ export function getPermissionIds(roleId: any) {
* @constructor
*/
export function DoAuthz(roleId: any, permissionIds: any) {
return request({
return await request({
url: apiPrefix + "/authz",
method: "post",
data: { roleId, permissionIds }
@@ -1,7 +1,7 @@
import { request } from "/src/api/service";
const apiPrefix = "/sys/authority/user";
export async function GetList(query: any) {
return request({
return await request({
url: apiPrefix + "/page",
method: "post",
data: query
@@ -9,7 +9,7 @@ export async function GetList(query: any) {
}
export async function AddObj(obj: any) {
return request({
return await request({
url: apiPrefix + "/add",
method: "post",
data: obj
@@ -17,7 +17,7 @@ export async function AddObj(obj: any) {
}
export async function UpdateObj(obj: any) {
return request({
return await request({
url: apiPrefix + "/update",
method: "post",
data: obj
@@ -25,7 +25,7 @@ export async function UpdateObj(obj: any) {
}
export async function DelObj(id: any) {
return request({
return await request({
url: apiPrefix + "/delete",
method: "post",
params: { id }
@@ -33,7 +33,7 @@ export async function DelObj(id: any) {
}
export async function GetObj(id: any) {
return request({
return await request({
url: apiPrefix + "/info",
method: "post",
params: { id }