pref: 删除静默登录
This commit is contained in:
@@ -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)];
|
||||
|
||||
Reference in New Issue
Block a user