<template></template>

<script>
export default {
  name: 'WxCallback',
  mounted() {
    const url = new URL(window.location.href)
    const code = url.searchParams.get('code')

    if (code) {
      sessionStorage.setItem('wx_callback_code', code)
      sessionStorage.setItem('wx_code_processed', '1')
      // 跳转到登录页，让用户完成注册/登录
      this.$router.replace('/Login')
    } else {
      this.$router.replace('/')
    }
  }
}
</script>