index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  4. __name: "index",
  5. setup(__props) {
  6. var _a;
  7. const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  8. const openid = common_vendor.computed(() => {
  9. return common_vendor.index.getStorageSync("openid");
  10. });
  11. const config = common_vendor.ref({});
  12. const initUser = async () => {
  13. const res = await $api(`/system/matchUser/find`, "GET", {
  14. openid: openid.value
  15. });
  16. if (res.code === 200) {
  17. if (res.data)
  18. console.log(res.data);
  19. } else {
  20. common_vendor.index.showToast({
  21. title: res.msg || "",
  22. icon: "error"
  23. });
  24. }
  25. };
  26. const searchConfig = async () => {
  27. config.value = common_vendor.index.getStorageSync("config");
  28. };
  29. initUser();
  30. searchConfig();
  31. return (_ctx, _cache) => {
  32. return {};
  33. };
  34. }
  35. });
  36. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/project/足球比赛/match_applet/pages/home/index.vue"]]);
  37. wx.createPage(MiniProgramPage);