<template>
  <div class="layout">
    <router-view />
  </div>
</template>

<script setup lang="ts">
import { setToken, setTokenFrom } from '@/utils/auth';
import { useRoute } from 'vue-router';

const route = useRoute();

if (route.query?.token) {
  setToken(route.query.token as string);
  setTokenFrom('iframe');
}
</script>

<style lang="less" scoped>
.layout {
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--color-fill-2);
  transition: padding 0.2s cubic-bezier(0.34, 0.69, 0.1, 0.1);
}
</style>
