质押cec 查询是否绑定passport账号

This commit is contained in:
yuyongdong 2024-09-12 13:24:48 +08:00
parent da3f90c391
commit 9b55445dc8
3 changed files with 24 additions and 2 deletions

View File

@ -15,7 +15,7 @@ export const useStakingStore = defineStore('staking', () => {
esCecCollection: BigInt('0'),
totalCollection: BigInt('0'),
})
// const currencyPrice = ref([])
const bindPassportAddress = ref([])
@ -23,6 +23,10 @@ export const useStakingStore = defineStore('staking', () => {
cecInfoData.value = _connected;
}
const updateBindPassportAddressStatus = (_connected) => {
bindPassportAddress.value = _connected;
}
// const priceDatas = computed(() => {
@ -32,7 +36,8 @@ export const useStakingStore = defineStore('staking', () => {
return {
cecInfoData
cecInfoData,
bindPassportAddress
}
},
{

View File

@ -230,3 +230,9 @@ export const apiGameLog = async (data) => {
const url = `https://gamelog-test.kingsome.cn/webapp/index.php?c=GameLog&a=customReport`
return httpPost(url,data)
}
// 判断是否绑定passport账号
export const apiVipInfo = async () => {
const url = `${API_BASE}/api/vip/info`
return httpGet(url)
}

View File

@ -58,6 +58,7 @@ import Staking from "@/components/staking/index.vue";
import Conversion from "@/components/staking/conversion.vue";
import { BlockChain } from "@/components/chain/BlockChain"
// import { switchEthereumChain } from "@/components/chain/utils"
import { apiVipInfo } from "@/utils/marketplace"
import {walletStore} from "@/store/wallet";
import { useStakingStore } from "@/store/staking"
@ -103,6 +104,15 @@ const getNetId = async () => {
await new BlockChain().checkNetId(localWalletStore.walletType)
}
// passport
const getVipInfo = async () => {
const { errcode, info } = await apiVipInfo()
console.log('bind_passport_address',info.bind_passport_address)
if(errcode == 0) {
stakingStore.bindPassportAddress = info.bind_passport_address
}
}
//
const toTwitter = () => {
const url = "https://twitter.com/intent/tweet?text=";
@ -117,6 +127,7 @@ onMounted(() => {
console.log(toRaw(stakingStore.cecInfoData))
if(localWalletStore.address) {
getNetId()
getVipInfo()
}
})
</script>