<template>
	<div>
		登录
	</div>
</template>

<script setup>
import {
  Login
} from "@/api/api.js";
import {
  ElMessage
} from 'element-plus'
import {
  ref,nextTick,onMounted
} from 'vue'
const login=()=>{
  Login().then(res=>{
    console.log(res)
    if(res.status){
      sessionStorage.setItem('token', res.data.token);
      sessionStorage.setItem('refreshToken', res.data.refresh_token);
      var token = sessionStorage.getItem('token');
      if (token == res.data.token) {
        window.location.href="./#/index"
      }

    }else{
      ElMessage.error(res.data.msg)
    }
  })
}
onMounted(() => {
  login()
})
</script>

<style scoped>
</style>