<template>
  <router-view v-slot="{ Component }">
    <transition name="zoom-fade" mode="out-in" appear>
      <component :is="Component" />
    </transition>
  </router-view>
</template>
<script setup name="App">
import { getUrlParam } from "./utils";
import LibForWeixin from "./utils/LibForWeixin";
import { useAppStore } from "./store";
import { useRouter } from "vue-router";

const router = useRouter();
const appStore = useAppStore();
appStore.getGlobalConfig();
const code = getUrlParam("code");
if (!code) {
  LibForWeixin.auth();
} else {
  // userStore.requestOpenId(code);
  router.push({ name: "WxLogin", query: { code } });
}
</script>
