feat(auth): 实现登录和实名认证的跳转逻辑
- 在登录页面添加对 fddCheck 的调用,处理特定的跳转逻辑 - 在实名认证页面添加路由查询参数处理,优化页面加载 - 优化直播室页面的代码结构,提高可读性
This commit is contained in:
parent
71e7f4223a
commit
2f2f2e1294
@ -12,6 +12,7 @@ import {message} from "~/components/x-message/useMessage.js"
|
|||||||
import {showConfirmDialog} from 'vant';
|
import {showConfirmDialog} from 'vant';
|
||||||
import {artworkBuy} from "@/api/goods/index.js"
|
import {artworkBuy} from "@/api/goods/index.js"
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
|
|
||||||
const player = ref(null)
|
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('')
|
const pullLink = ref('')
|
||||||
@ -118,7 +119,8 @@ const updateShow=()=>{
|
|||||||
<van-button @click="goBuy" color="#FFB25F" class="w-344px !h-[40px]">
|
<van-button @click="goBuy" color="#FFB25F" class="w-344px !h-[40px]">
|
||||||
<div>{{
|
<div>{{
|
||||||
$t('live_room.confirm')` ${auctionData?.nowAuctionPrice?.currency} ${auctionData?.nowAuctionPrice?.nextPrice ?? 0}`
|
$t('live_room.confirm')` ${auctionData?.nowAuctionPrice?.currency} ${auctionData?.nowAuctionPrice?.nextPrice ?? 0}`
|
||||||
}}</div>
|
}}
|
||||||
|
</div>
|
||||||
</van-button>
|
</van-button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="mt-10px mb-10px">
|
<div v-else class="mt-10px mb-10px">
|
||||||
|
@ -5,6 +5,7 @@ import countryCode from '../countryRegion/data/index.js'
|
|||||||
import {senCode, userLogin} from "@/api/auth/index.js";
|
import {senCode, userLogin} from "@/api/auth/index.js";
|
||||||
import {authStore} from "@/stores/auth/index.js";
|
import {authStore} from "@/stores/auth/index.js";
|
||||||
import {message} from '@/components/x-message/useMessage.js'
|
import {message} from '@/components/x-message/useMessage.js'
|
||||||
|
import {fddCheck} from "~/api/goods/index.js";
|
||||||
const {userInfo,token}= authStore()
|
const {userInfo,token}= authStore()
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@ -126,7 +127,13 @@ const goLogin =async () => {
|
|||||||
query:{
|
query:{
|
||||||
statusCode:0
|
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 {
|
}else {
|
||||||
await router.push('/');
|
await router.push('/');
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,11 @@ import {authStore} from "@/stores/auth/index.js";
|
|||||||
import XVanDate from '@/components/x-van-date/index.vue'
|
import XVanDate from '@/components/x-van-date/index.vue'
|
||||||
import XVanSelect from '@/components/x-van-select/index.vue'
|
import XVanSelect from '@/components/x-van-select/index.vue'
|
||||||
import {fddCheck} from "~/api/goods/index.js";
|
import {fddCheck} from "~/api/goods/index.js";
|
||||||
|
definePageMeta({
|
||||||
|
i18n: 'realAuth.title',
|
||||||
|
})
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
const { locale } = useI18n()
|
const { locale } = useI18n()
|
||||||
const {userInfo}= authStore()
|
const {userInfo}= authStore()
|
||||||
const active=ref(locale.value==='zh-CN'?0:1)
|
const active=ref(locale.value==='zh-CN'?0:1)
|
||||||
@ -45,7 +49,7 @@ function isFormComplete(obj) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const statusCode=ref(0)
|
const statusCode=ref(Number(route.query.statusCode))
|
||||||
const confirm=async ()=>{
|
const confirm=async ()=>{
|
||||||
const thatForm=active.value===0?form1.value:form.value
|
const thatForm=active.value===0?form1.value:form.value
|
||||||
thatForm.userExtend.isMainland=active.value===0?1:0
|
thatForm.userExtend.isMainland=active.value===0?1:0
|
||||||
@ -54,10 +58,11 @@ const confirm=async ()=>{
|
|||||||
if (res.status===0){
|
if (res.status===0){
|
||||||
userInfo.value=res.data
|
userInfo.value=res.data
|
||||||
message.success(t('realAuth.success_mess'))
|
message.success(t('realAuth.success_mess'))
|
||||||
/*statusCode.value=1*/
|
|
||||||
const res1=await fddCheck()
|
const res1=await fddCheck()
|
||||||
if (res1.status===0){
|
if (res1.status===0){
|
||||||
console.log('res1',res1)
|
if (!res1.data.isNeedJump){
|
||||||
|
window.open(res1.data.h5Url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
@ -71,9 +76,7 @@ const goHome=()=>{
|
|||||||
const goLogin=()=>{
|
const goLogin=()=>{
|
||||||
router.back()
|
router.back()
|
||||||
}
|
}
|
||||||
definePageMeta({
|
|
||||||
i18n: 'realAuth.title',
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
Loading…
Reference in New Issue
Block a user