From 2f2f2e1294bb714d932587f23a2a2efb348fc0f2 Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Mon, 17 Feb 2025 13:33:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(auth):=20=E5=AE=9E=E7=8E=B0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=92=8C=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81=E7=9A=84?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在登录页面添加对 fddCheck 的调用,处理特定的跳转逻辑 - 在实名认证页面添加路由查询参数处理,优化页面加载 - 优化直播室页面的代码结构,提高可读性 --- app/pages/liveRoom/index.client.vue | 16 +++++++++------- app/pages/login/index.vue | 9 ++++++++- app/pages/realAuth/index.vue | 15 +++++++++------ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue index 8a0c6d0..c35587b 100644 --- a/app/pages/liveRoom/index.client.vue +++ b/app/pages/liveRoom/index.client.vue @@ -9,11 +9,12 @@ import paymentResults from '@/pages/liveRoom/components/PaymentResults/index.vue import paymentInput from '@/pages/liveRoom/components/PaymentInput/index.vue' import {goodStore} from "@/stores/goods/index.js" import {message} from "~/components/x-message/useMessage.js" -import { showConfirmDialog } from 'vant'; +import {showConfirmDialog} from 'vant'; import {artworkBuy} from "@/api/goods/index.js" import {useI18n} from 'vue-i18n' + const player = ref(null) -const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink,fullLive} = liveStore() +const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink, fullLive} = liveStore() const pullLink = ref('') @@ -51,12 +52,12 @@ const initializePlayer = async () => { } catch (error) { showConfirmDialog({ message: useI18n().t('live_room.error_mess'), - showCancelButton:true + showCancelButton: true }).then(() => { location.reload() // on close - }) .catch(() => { + }).catch(() => { // on cancel }) console.error('播放器初始化失败:', error) @@ -72,7 +73,7 @@ onBeforeUnmount(() => { player.value?.dispose() player.value = null }) -watch(()=>fullLive.value, (newVal) => { +watch(() => fullLive.value, (newVal) => { if (newVal) { getSocketData() } @@ -91,7 +92,7 @@ const goBuy = async () => { const tipOpen = () => { message.warning(useI18n().t('live_room.warn_mess')) } -const updateShow=()=>{ +const updateShow = () => { } @@ -118,7 +119,8 @@ const updateShow=()=>{
{{ $t('live_room.confirm')` ${auctionData?.nowAuctionPrice?.currency} ${auctionData?.nowAuctionPrice?.nextPrice ?? 0}` - }}
+ }} +
diff --git a/app/pages/login/index.vue b/app/pages/login/index.vue index b0954d6..a2c4c43 100644 --- a/app/pages/login/index.vue +++ b/app/pages/login/index.vue @@ -5,6 +5,7 @@ import countryCode from '../countryRegion/data/index.js' import {senCode, userLogin} from "@/api/auth/index.js"; import {authStore} from "@/stores/auth/index.js"; import {message} from '@/components/x-message/useMessage.js' +import {fddCheck} from "~/api/goods/index.js"; const {userInfo,token}= authStore() const router = useRouter(); const route = useRoute(); @@ -126,7 +127,13 @@ const goLogin =async () => { query:{ statusCode:0 } - }); + }) + }else if (res.data.isJumpFdd){ + const res1=await fddCheck() + if (res1.status===0){ + window.location.href=res1.data.h5Url + } + console.log('123') }else { await router.push('/'); } diff --git a/app/pages/realAuth/index.vue b/app/pages/realAuth/index.vue index 24be68f..e473d64 100644 --- a/app/pages/realAuth/index.vue +++ b/app/pages/realAuth/index.vue @@ -8,7 +8,11 @@ import {authStore} from "@/stores/auth/index.js"; import XVanDate from '@/components/x-van-date/index.vue' import XVanSelect from '@/components/x-van-select/index.vue' import {fddCheck} from "~/api/goods/index.js"; +definePageMeta({ + i18n: 'realAuth.title', +}) const router = useRouter(); +const route = useRoute(); const { locale } = useI18n() const {userInfo}= authStore() const active=ref(locale.value==='zh-CN'?0:1) @@ -45,7 +49,7 @@ function isFormComplete(obj) { return true; } -const statusCode=ref(0) +const statusCode=ref(Number(route.query.statusCode)) const confirm=async ()=>{ const thatForm=active.value===0?form1.value:form.value thatForm.userExtend.isMainland=active.value===0?1:0 @@ -54,10 +58,11 @@ const confirm=async ()=>{ if (res.status===0){ userInfo.value=res.data message.success(t('realAuth.success_mess')) - /*statusCode.value=1*/ const res1=await fddCheck() if (res1.status===0){ - console.log('res1',res1) + if (!res1.data.isNeedJump){ + window.open(res1.data.h5Url) + } } } }else { @@ -71,9 +76,7 @@ const goHome=()=>{ const goLogin=()=>{ router.back() } -definePageMeta({ - i18n: 'realAuth.title', -}) +