"use strict"; const common_vendor = require("../../common/vendor.js"); const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "index", setup(__props) { var _a, _b, _c; const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api; const $app = (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$app; const $config = (_c = common_vendor.getCurrentInstance()) == null ? void 0 : _c.appContext.config.globalProperties.$config; const config = common_vendor.ref({ logo: [] }); common_vendor.onLoad(async () => { await searchConfig(); await search(); }); const searchConfig = async () => { let res = await $api(`config`, "GET", {}); if (res.errcode == 0) { config.value = res.data; common_vendor.index.setStorage({ key: "config", data: res.data }); } }; const search = async () => { common_vendor.index.getStorage({ key: "openid", success: function(res) { common_vendor.index.reLaunch({ url: `/pages/home/index` }); }, fail: function(err) { common_vendor.index.login({ success: async function(res) { if (res.code) { common_vendor.index.reLaunch({ url: `/pages/home/index` }); const aee = await $app("/wechat/api/login/app", "GET", { js_code: res.code, config: $config.wx_projectkey }); if (aee.errcode == "0") { common_vendor.index.setStorage({ key: "openid", data: aee.data.openid }); common_vendor.index.reLaunch({ url: `/pages/home/index` }); } else { common_vendor.index.showToast({ title: aee.errmsg, icon: "none" }); } } else { common_vendor.index.showToast({ title: res.errMsg, icon: "none" }); } } }); } }); }; return (_ctx, _cache) => { var _a2, _b2; return { a: ((_b2 = (_a2 = config.value) == null ? void 0 : _a2.logo[0]) == null ? void 0 : _b2.url) || "/static/logo.png" }; }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"], ["__file", "D:/project/赋强公证/notarization_applet/pages/index/index.vue"]]); wx.createPage(MiniProgramPage);