仅正式环境判断设备在线

This commit is contained in:
kron
2026-01-04 11:36:31 +08:00
parent 60b1006447
commit 9f7523839d
6 changed files with 44 additions and 90 deletions

View File

@@ -827,3 +827,30 @@ export const wxLogin = () => {
});
});
};
export const canEenter = (user, device, online, page = "") => {
const { miniProgram } = uni.getAccountInfoSync();
if (miniProgram.envVersion !== "release") return true;
if (!device.deviceId) {
uni.showToast({
title: "请先绑定设备",
icon: "none",
});
return false;
}
if (!online) {
uni.showToast({
title: "智能弓未连接",
icon: "none",
});
return false;
}
if (!user.trio && page !== "/pages/first-try") {
uni.showToast({
title: "请先完成新手试炼",
icon: "none",
});
return false;
}
return true;
};