完善功能

This commit is contained in:
2025-04-10 18:11:03 +08:00
parent b71c2bd071
commit 0bbe30bc7e
9 changed files with 324 additions and 89 deletions

View File

@@ -47,18 +47,14 @@ export function usePythonBridge() {
// 登录tk后台
const loginBackStage = (data) => {
return new Promise((resolve, reject) => {
if (bridge.value) {
bridge.value.loginBackStage(data, function (result) {
if (result) {
resolve(result);
} else {
reject(result);
}
});
if (bridge.value) {
if (data.index == 0) {
bridge.value.loginBackStage(JSON.stringify(data));
} else if (data.index == 1) {
bridge.value.loginBackStageCopy(JSON.stringify(data));
}
});
}
};
//跳转到主播页面
@@ -70,6 +66,31 @@ export function usePythonBridge() {
});
}
};
//查询登录状态
const backStageloginStatus = () => {
return new Promise((resolve, reject) => {
if (bridge.value) {
bridge.value.backStageloginStatus(function (result) {
resolve(result);
});
}
});
};
//查询登录状态
const backStageloginStatusCopy = () => {
return new Promise((resolve, reject) => {
if (bridge.value) {
bridge.value.backStageloginStatusCopy(function (result) {
resolve(result);
});
}
});
};
// 在组件挂载时初始化桥接
onMounted(initBridge);
@@ -78,6 +99,8 @@ export function usePythonBridge() {
fetchDataCount,
loginBackStage,
loginTikTok,
givePyAnchorId
givePyAnchorId,
backStageloginStatus,
backStageloginStatusCopy
};
}