仅正式环境判断设备在线
This commit is contained in:
27
src/util.js
27
src/util.js
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user