index.vue 925 Bytes
<!--
 * @Date: 2022-09-19 14:11:06
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2024-05-26 10:17:04
 * @FilePath: /xyxBooking-weapp/src/pages/auth/index.vue
 * @Description: 文件描述
-->
<template>
  <view class="auth-page">
    <view class="loading">
        <view>正在授权登录...</view>
    </view>
  </view>
</template>

<script setup>
import Taro, { useDidShow } from '@tarojs/taro'
import { silentAuth, returnToOriginalPage } from '@/utils/authRedirect'

useDidShow(() => {
    silentAuth()
      .then(() => returnToOriginalPage('/pages/index/index'))
      .catch((error) => {
        Taro.showToast({ title: error?.message || '授权失败', icon: 'none' })
      })
})
</script>

<style lang="less">
.auth-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    .loading {
        text-align: center;
        color: #999;
    }
}
</style>