"use strict";
const common_vendor = require("../../common/vendor.js");
const api = require("../../api.js");
const common_assets = require("../../common/assets.js");
const _sfc_main = common_vendor.defineComponent({
  data() {
    return {
      avatar: "",
      nickName: ""
    };
  },
  mounted() {
    api.isToken();
    this.avatar = getApp().usrInfo.avatar;
    this.nickName = getApp().usrInfo.nickName;
    common_vendor.index.__f__("log", "at pages/index/wode.uvue:55", common_vendor.index.getStorageSync("token"));
  },
  methods: {
    logout() {
      common_vendor.index.showModal({
        title: "提示",
        content: "确定要退出登录吗？",
        success: (res) => {
          if (res.confirm) {
            api.logout().then((res2 = null) => {
              if (res2.success) {
                common_vendor.index.showToast({
                  title: "退出登录成功",
                  icon: "success",
                  success: () => {
                    common_vendor.index.clearStorageSync();
                    setTimeout(() => {
                      common_vendor.index.navigateTo({ url: "/pages/index/login" });
                    }, 1500);
                  }
                });
              }
            });
          }
        }
      });
    }
  }
});
if (!Array) {
  const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  _easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
  _easycom_uni_icons();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return {
    a: $data.avatar,
    b: common_vendor.t($data.nickName),
    c: common_assets._imports_0$2,
    d: common_vendor.p({
      type: "right"
    }),
    e: common_assets._imports_1$1,
    f: common_vendor.p({
      type: "right"
    }),
    g: common_assets._imports_2$1,
    h: common_vendor.p({
      type: "right"
    }),
    i: common_vendor.o((...args) => $options.logout && $options.logout(...args)),
    j: common_vendor.sei(_ctx.virtualHostId, "view")
  };
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/wode.js.map
