<template>
    <router-view></router-view>
</template>

<script setup>
import { onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";

import Cookies from "js-cookie";

const route = useRoute();
const router = useRouter();

onMounted(async () => {
    await router.isReady();

    if (route.query.refer !== undefined) {
        Cookies.set("refer_code", route.query.refer, { expires: 1 });
    }
});
</script>

<style lang="less"></style>
