<script setup lang="ts">
import { onMounted } from "vue";
import { useRoute } from "vue-router";
import { setAuthen } from "@/plugins/auth";

const route = useRoute();

onMounted(async () => {
  if (route.query.token && route.query.accessToken) {
    const params: any = await {
      access_token: route.query.token,
      expires_in: route.query.expires ? route.query.expires : 36000,
      refresh_token: route.query.accessToken,
    };
    setAuthen(
      params,
      "y",
      route.query.redirectUrl ? (route.query.redirectUrl as string) : "/"
    );
  }
});
</script>

<template>
  <div></div>
</template>
