完善提示

This commit is contained in:
kron
2025-08-06 11:37:24 +08:00
parent 5191f33fce
commit b286a236ee

View File

@@ -22,14 +22,22 @@ const handleScan = () => {
onlyFromCamera: true,
scanType: ["qrCode"],
success: async (res) => {
const base64Decode = (str) => {
// 将 base64 转换为 utf8 字符串
const bytes = wx.base64ToArrayBuffer(str);
return String.fromCharCode.apply(null, new Uint8Array(bytes));
};
try {
const base64Decode = (str) => {
// 将 base64 转换为 utf8 字符串
const bytes = wx.base64ToArrayBuffer(str);
return String.fromCharCode.apply(null, new Uint8Array(bytes));
};
addDevice.value = JSON.parse(base64Decode(res.result));
confirmBindTip.value = true;
addDevice.value = JSON.parse(base64Decode(res.result));
confirmBindTip.value = true;
} catch (err) {
uni.showToast({
title: "无效二维码",
icon: "none",
duration: 2000,
});
}
},
fail: (err) => {
console.error("扫码失败:", err);