diff --git a/src/store/staking.js b/src/store/staking.js index 9ca3f55..7a2001b 100644 --- a/src/store/staking.js +++ b/src/store/staking.js @@ -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 } }, { diff --git a/src/utils/marketplace.js b/src/utils/marketplace.js index 24a4fd7..dc5879d 100644 --- a/src/utils/marketplace.js +++ b/src/utils/marketplace.js @@ -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) +} diff --git a/src/views/StakingView.vue b/src/views/StakingView.vue index f67a0af..a3e64bd 100644 --- a/src/views/StakingView.vue +++ b/src/views/StakingView.vue @@ -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() } })