"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
if (!Math) {
  (common_vendor.unref(orderDateils) + common_vendor.unref(setting))();
}
const setting = () => "../setting/setting.js";
const orderDateils = () => "../orderDetaiols.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "my",
  setup(__props) {
    common_vendor.onShow(() => {
      getLoginUser();
    });
    const user = common_vendor.ref({
      userAvatar: "",
      userName: "",
      message: ""
    });
    const getLoginUser = () => {
      common_vendor.index.request({
        url: API_api.apiImageUrl + "/api/user/current",
        method: "GET",
        header: {
          "cookie": common_vendor.index.getStorageSync("cookie")
        },
        data: {},
        success: (res) => {
          console.log(res.data.message);
          user.value.message = res.data.message;
          if (user.value.message === "ok") {
            user.value.userName = res.data.data.username;
            user.value.userAvatar = res.data.data.avatarUrl;
          }
          console.log(res);
          console.log("我的获取当前登录信息");
        },
        fail() {
          console.log("出错啦");
        }
      });
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: user.value.message === "ok"
      }, user.value.message === "ok" ? {
        b: user.value.userAvatar,
        c: common_vendor.t(user.value.userName)
      } : {});
    };
  }
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/111111000000/uniapp04/pages/my/my.vue"]]);
my.createPage(MiniProgramPage);
