<script setup lang="ts">
import { RouterLink, RouterView } from "vue-router";
import HelloWorld from "./components/HelloWorld.vue";
import { authorize } from "./request/api";
import { ElMessage } from "element-plus";
import router from "./router";
import { useStore } from "@/stores/counter";
const store = useStore();
// authorize().then((res) => {
//   console.log(res);
//   if (res.data.status == 200) {
//     // window.localStorage.setItem("uesrname", res.data.message.username);
//     store.auth.user = res.data.message.username;
//     router.push("/home");
//     ElMessage.success("已经登录");
//     // console.log("da");
//     // console.log(store.auth.user);

//     // console.log(window.localStorage.getItem("username"));
//   } else {
//     // localStorage.setItem("uesrname", "");
//     store.auth.user = null;
//     ElMessage.error("用户未登录");
//   }
// });
// if (store.auth.user != null) {
//   router.push("/home");
//   ElMessage.success("已经登录");
// } else {
//   ElMessage.error("用户未登录");
// }
</script>

<template>
  <RouterView />
</template>

<style scoped></style>
