<template>
  <div id="app">
    <router-view />
    <theme-picker />
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker";
import { xzTree } from "@/api/yingji/keyEnterprise.js";
// import { mapState } from "vuex";

export default {
  name: "App",
  destroyed() {
    localStorage.removeItem("isGovernmentAffairsNetwork");
  },
  components: { ThemePicker },
  metaInfo() {
    return {
      title:
        this.$store.state.settings.dynamicTitle &&
        this.$store.state.settings.title,
      titleTemplate: (title) => {
        return title
          ? `${title} - ${process.env.VUE_APP_TITLE}`
          : process.env.VUE_APP_TITLE;
      },
    };
  },
  created() {
    // 行政区域树状
    xzTree().then((res) => {
      localStorage.setItem("TREE_DATA", JSON.stringify(res.data));
    });
  },
  computed: {
    // ...mapState({
    //   isorgpwd: (state) => state.user.isorgpwd,
    // }),
  },
  watch: {
    // isorgpwd(newVal, oldVal) {
    //   // 还是调个接口
    //   let _this = this
    //   if (newVal) {
    //     this.$alert("您的密码为原始密码，需要修改！", "警告信息", {
    //       confirmButtonText: "确定",
    //       showClose: false,
    //       callback: (action) => {
    //         _this.$router.push("/user/profile");
    //       },
    //     });
    //   }
    // },
  },
};
</script>
<style scoped>
#app .theme-picker {
  display: none;
}
</style>
