<script setup>
import { tokens, queryCurrentUser } from "@/api/api";
const store = useStore();
const envMode = process.env.NODE_ENV;
onMounted(async () => {
  if (envMode == "development") {
    let resToken = await tokens();
    await localStorage.setItem("TOKENES", resToken.access_token);
    let userInfo = await queryCurrentUser();
    if (userInfo) {
      store.commit('CHANGE_USER', {
        currentUser: userInfo?.data?.data ?? {}
      });
    }
  } else {
    let userInfo = await queryCurrentUser();
    if (userInfo) {
      store.commit('CHANGE_USER', {
        currentUser: userInfo?.data?.data ?? {}
      });
    }
  }


})
</script>
<template>
  <div id="root-techui" :class="`root-BG lang-${store.state.lang}`">
    <router-view></router-view>
  </div>
</template>
<style lang="less"></style>
