优化代码

This commit is contained in:
pengxiaolong
2025-08-05 22:05:56 +08:00
parent 3eddd94922
commit 40c3282515
86 changed files with 1700 additions and 399 deletions

View File

@@ -1,4 +1,4 @@
function VerifyLogin() {
function VerifyLogin(id) {
return new Promise((resolve, reject) => {
uni.getStorage({
@@ -8,19 +8,18 @@ function VerifyLogin() {
if (res.data.nickName) {
resolve(true);
} else {
uni.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route);
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);
uni.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route+"?inid=" + id);
uni.navigateTo({ url: '/pages/login/login' });
resolve(false);
}
},
fail: (err) => {
console.error("获取用户信息失败", err);
uni.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route);
uni.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route+"?inid=" + id);
uni.navigateTo({ url: '/pages/login/login' });
reject(err);
}