更换分享

This commit is contained in:
XGL-THINKPAD-X1\rucky
2024-01-18 18:10:08 +08:00
parent d9ec9fbbc6
commit cac9a17d36
4 changed files with 34 additions and 7 deletions

View File

@@ -96,7 +96,6 @@ onMounted(() => {
showLoad.value = true
return
} else {
console.log('hhhh');
authorize({ scopeType: 1 }).then(
res => {
@@ -127,7 +126,7 @@ onMounted(() => {
}
// 其余情况
Toast.fail({
Toast({
message: res.msg,
duration: 0,
forbidClick: true
@@ -173,10 +172,35 @@ onMounted(() => {
showLoad.value = true
}
fontAdpat()
});
// 字体适配
const fontAdpat = () => {
if (
typeof WeixinJSBridge == "object" &&
typeof WeixinJSBridge.invoke == "function"
) {
handleFontSize();
} else {
if (document.addEventListener) {
document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
} else if (document.attachEvent) {
document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
}
}
function handleFontSize() {
// 设置网页字体为默认大小
WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 });
// 重写设置网页字体大小的事件
WeixinJSBridge.on("menu:setfont", function () {
WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 });
});
}
};
</script>
<style lang="scss" >