mirror of
https://github.com/certd/certd.git
synced 2026-05-16 13:17:29 +08:00
chore:
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user