From e0e6a3a8bebc6f2ba2e631eb71248c2eecf6909a Mon Sep 17 00:00:00 2001 From: bootx Date: Wed, 27 Aug 2025 13:35:31 +0800 Subject: [PATCH] =?UTF-8?q?style=20=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/daxpay/h5/auth/alipay/AlipayAuth.vue | 7 ++++++- src/views/daxpay/h5/auth/wechat/WechatAuth.vue | 8 ++++++-- src/views/daxpay/h5/result/PaySuccess.vue | 5 ++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/views/daxpay/h5/auth/alipay/AlipayAuth.vue b/src/views/daxpay/h5/auth/alipay/AlipayAuth.vue index 3aac4b6..5b65eb7 100644 --- a/src/views/daxpay/h5/auth/alipay/AlipayAuth.vue +++ b/src/views/daxpay/h5/auth/alipay/AlipayAuth.vue @@ -14,6 +14,7 @@ import { ref } from 'vue' import { showDialog } from 'vant' import type { AuthCodeParam } from '@/views/daxpay/h5/auth/ChannelAuth.api' import { authAndSet } from '@/views/daxpay/h5/auth/ChannelAuth.api' +import router from '@/router' const script = document.createElement('script') script.setAttribute( @@ -47,7 +48,11 @@ async function init() { authCode: authCode as string, channel: channel as string, }) - authAndSet(param.value).then(() => { + authAndSet(param.value).then(({ code, msg }) => { + if (code !== 0) { + router.replace({ name: 'payFail', query: { msg, title: '获取信息失败' } }) + return + } show.value = false showDialog({ message: '已成功获取用户信息!', diff --git a/src/views/daxpay/h5/auth/wechat/WechatAuth.vue b/src/views/daxpay/h5/auth/wechat/WechatAuth.vue index 2cac021..b73c7c9 100644 --- a/src/views/daxpay/h5/auth/wechat/WechatAuth.vue +++ b/src/views/daxpay/h5/auth/wechat/WechatAuth.vue @@ -14,6 +14,7 @@ import { onMounted, ref } from 'vue' import { showDialog } from 'vant' import type { AuthCodeParam } from '@/views/daxpay/h5/auth/ChannelAuth.api' import { authAndSet } from '@/views/daxpay/h5/auth/ChannelAuth.api' +import router from '@/router' const route = useRoute() const { appId, channel, queryCode } = route.params @@ -35,7 +36,11 @@ onMounted(() => { * 页面初始化 */ async function init() { - authAndSet(param.value).then(() => { + authAndSet(param.value).then(({ code, msg }) => { + if (code !== 0) { + router.replace({ name: 'payFail', query: { msg, title: '获取信息失败' } }) + return + } show.value = false showDialog({ message: '已成功获取用户信息!', @@ -48,7 +53,6 @@ async function init() {