diff --git a/src/pages/index.vue b/src/pages/index.vue index 72944f5..2020cdb 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -68,28 +68,29 @@ onShow(async () => { const token = uni.getStorageSync(`${env}_token`); if (!user.value.id && !token) { - try { - const wxResult = await uni.login({provider: "weixin"}); - const bindResult = await checkUserBindAPI(wxResult.code); - if (bindResult.binded) { - const newResult = await uni.login({provider: "weixin"}); - const silentResult = await silentLoginAPI(newResult.code); - if (silentResult.user) updateUser(silentResult.user); - const devices = await getMyDevicesAPI(); - if (devices.bindings && devices.bindings.length) { - updateDevice( - devices.bindings[0].deviceId, - devices.bindings[0].deviceName - ); - const data = await getDeviceBatteryAPI(); - updateOnline(data.online); - } - } else { - showModal.value = true; - } - } catch (e) { - console.log("检查绑定状态失败", e); - } + // showModal.value = true; + // try { + // const wxResult = await uni.login({provider: "weixin"}); + // const bindResult = await checkUserBindAPI(wxResult.code); + // if (bindResult.binded) { + // const newResult = await uni.login({provider: "weixin"}); + // const silentResult = await silentLoginAPI(newResult.code); + // if (silentResult.user) updateUser(silentResult.user); + // const devices = await getMyDevicesAPI(); + // if (devices.bindings && devices.bindings.length) { + // updateDevice( + // devices.bindings[0].deviceId, + // devices.bindings[0].deviceName + // ); + // const data = await getDeviceBatteryAPI(); + // updateOnline(data.online); + // } + // } else { + // showModal.value = true; + // } + // } catch (e) { + // console.log("检查绑定状态失败", e); + // } } const promises = [getScoreRankList(undefined, 1, 10)];