Files
tk-mini-program/unpackage/dist/dev/mp-weixin/components/VerifyLogin.js

32 lines
1.2 KiB
JavaScript
Raw Normal View History

2025-06-11 22:16:44 +08:00
"use strict";
const common_vendor = require("../common/vendor.js");
2025-08-05 22:05:56 +08:00
function VerifyLogin(id) {
2025-06-11 22:16:44 +08:00
return new Promise((resolve, reject) => {
common_vendor.index.getStorage({
key: "userinfo",
success: (res) => {
if (res.data) {
if (res.data.nickName) {
resolve(true);
} else {
2025-08-05 22:05:56 +08:00
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route + "?inid=" + id);
2025-06-11 22:16:44 +08:00
common_vendor.index.reLaunch({ url: "/pages/UserInformation/UserInformation" });
resolve(false);
}
} else {
2025-08-05 22:05:56 +08:00
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route + "?inid=" + id);
2025-06-11 22:16:44 +08:00
common_vendor.index.navigateTo({ url: "/pages/login/login" });
resolve(false);
}
},
fail: (err) => {
2025-08-05 22:05:56 +08:00
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route + "?inid=" + id);
2025-06-11 22:16:44 +08:00
common_vendor.index.navigateTo({ url: "/pages/login/login" });
reject(err);
}
});
});
}
exports.VerifyLogin = VerifyLogin;
//# sourceMappingURL=../../.sourcemap/mp-weixin/components/VerifyLogin.js.map