43 lines
1.8 KiB
JavaScript
43 lines
1.8 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../vendor.js");
|
|
require("../../libraries/request.js");
|
|
const common_store_useWeAppAuthStore = require("../../store/useWeAppAuthStore.js");
|
|
const common_libraries_userUserLogin = require("../../libraries/userUserLogin.js");
|
|
require("../../../gen/Apis.js");
|
|
require("../../libraries/apiLoading.js");
|
|
if (!Math) {
|
|
(Loading + NetworkError)();
|
|
}
|
|
const Loading = () => "./Loading.js";
|
|
const NetworkError = () => "./NetworkError.js";
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "cc-root-view",
|
|
setup(__props) {
|
|
const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
|
|
common_vendor.onLoad(async () => {
|
|
var _a;
|
|
console.log("cc-root-view onLoad 1", auth == null ? void 0 : auth.loading, auth == null ? void 0 : auth.hasError);
|
|
await ((_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$onLaunched);
|
|
console.log("cc-root-view onLoad 2");
|
|
});
|
|
common_vendor.onShow(async () => {
|
|
var _a;
|
|
await ((_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$onLaunched);
|
|
if (!common_libraries_userUserLogin.useUser.getLoginStatus()) {
|
|
common_vendor.index.redirectTo({
|
|
url: "/pages/login"
|
|
});
|
|
}
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.unref(auth).loading
|
|
}, common_vendor.unref(auth).loading ? {} : common_vendor.unref(auth).hasError ? {} : {}, {
|
|
b: common_vendor.unref(auth).hasError
|
|
});
|
|
};
|
|
}
|
|
});
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/common/components/cc-root-view/cc-root-view.vue"]]);
|
|
wx.createComponent(Component);
|