72 lines
2.4 KiB
JavaScript
72 lines
2.4 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
const common_vendor = require("./common/vendor.js");
|
|
const api_login = require("./api/login.js");
|
|
const utils_StaticValue = require("./utils/StaticValue.js");
|
|
if (!Math) {
|
|
"./pages/index/index.js";
|
|
"./pages/index/singleplay/singleplay.js";
|
|
"./pages/history-game/history-game.js";
|
|
"./pages/my/my.js";
|
|
"./pages/index/singleplay/change.js";
|
|
"./pages/index/singleplay/scoring.js";
|
|
"./pages/my/feedback.js";
|
|
"./pages/my/setting.js";
|
|
"./pages/my/favorites.js";
|
|
}
|
|
const _sfc_main = {
|
|
onLaunch: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:4", "App Launch");
|
|
},
|
|
onShow: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:7", "App Show");
|
|
},
|
|
onHide: function() {
|
|
common_vendor.index.__f__("log", "at App.vue:10", "App Hide");
|
|
}
|
|
};
|
|
let globalUserInfo = null;
|
|
function initGlobalUserInfo() {
|
|
try {
|
|
const storedUserInfo = common_vendor.wx$1.getStorageSync("userInfo");
|
|
if (storedUserInfo) {
|
|
globalUserInfo = storedUserInfo;
|
|
common_vendor.index.__f__("log", "at main.js:15", "初始化全局用户信息:", globalUserInfo);
|
|
}
|
|
} catch (error) {
|
|
common_vendor.index.__f__("error", "at main.js:18", "获取本地存储的用户信息失败:", error);
|
|
}
|
|
}
|
|
function updateGlobalUserInfo(userInfo) {
|
|
try {
|
|
globalUserInfo = userInfo;
|
|
common_vendor.wx$1.setStorageSync("userInfo", userInfo);
|
|
common_vendor.index.__f__("log", "at main.js:27", "全局用户信息已更新:", userInfo);
|
|
if (common_vendor.wx$1.$emit) {
|
|
common_vendor.wx$1.$emit("globalUserInfoUpdated", userInfo);
|
|
}
|
|
} catch (error) {
|
|
common_vendor.index.__f__("error", "at main.js:33", "更新全局用户信息失败:", error);
|
|
}
|
|
}
|
|
function getGlobalUserInfo() {
|
|
return globalUserInfo;
|
|
}
|
|
function createApp() {
|
|
const app = common_vendor.createSSRApp(_sfc_main);
|
|
app.config.globalProperties.$StaticValue = utils_StaticValue.StaticValue;
|
|
app.config.globalProperties.$updateGlobalUserInfo = updateGlobalUserInfo;
|
|
app.config.globalProperties.$getGlobalUserInfo = getGlobalUserInfo;
|
|
return {
|
|
app
|
|
};
|
|
}
|
|
initGlobalUserInfo();
|
|
api_login.checkLoginStatus();
|
|
api_login.getToken();
|
|
createApp().app.mount("#app");
|
|
exports.createApp = createApp;
|
|
exports.getGlobalUserInfo = getGlobalUserInfo;
|
|
exports.updateGlobalUserInfo = updateGlobalUserInfo;
|
|
//# sourceMappingURL=../.sourcemap/mp-weixin/app.js.map
|