2026-04-03 09:49:37 +08:00

42 lines
1.3 KiB
JavaScript

"use strict";
const common_vendor = require("../vendor.js");
require("./request.js");
const common_store_useWeAppAuthStore = require("../store/useWeAppAuthStore.js");
require("../store/useWorkStore.js");
const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
const getUserLogin = {
onBindPhone() {
var _a;
console.log("auth?.userInfo:", auth == null ? void 0 : auth.data);
if (!((_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.user)) {
common_vendor.index.showModal({
title: "登录",
content: "请先登录体验更多功能!",
success: function(res) {
if (res.confirm) {
common_vendor.index.navigateTo({
url: "/pages/login"
});
console.log("用户点击确定");
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
return false;
} else {
return true;
}
},
getLoginStatus() {
var _a, _b;
console.log("auth?.data?.user:", (_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.user);
if (!((_b = auth == null ? void 0 : auth.data) == null ? void 0 : _b.user)) {
return false;
} else {
return true;
}
}
};
exports.getUserLogin = getUserLogin;