function VerifyLogin(id) { return new Promise((resolve, reject) => { uni.getStorage({ key: "userinfo", success: (res) => { if (res.data) { if (res.data.nickName) { resolve(true); } else { uni.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route+"?inid=" + id); uni.reLaunch({ url: "/pages/UserInformation/UserInformation" }); resolve(false); } } else { uni.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route+"?inid=" + id); uni.navigateTo({ url: '/pages/login/login' }); resolve(false); } }, fail: (err) => { uni.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route+"?inid=" + id); uni.navigateTo({ url: '/pages/login/login' }); reject(err); } }); }); } export default VerifyLogin;