添加双重登录
This commit is contained in:
parent
9847e3cc21
commit
b85a05cc20
@ -18,7 +18,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="pages-no" v-show="nftList == undefined || nftList.length <= 0">
|
<div class="pages-no" v-show="nftList == undefined || nftList.length <= 0">
|
||||||
<div class="no-data-tips">
|
<div class="no-data-tips">
|
||||||
<span v-if="localWalletStore.walletType != 3">Please log into the wallet holding your Founder’s Tag to view details.</span>
|
<span v-if="localWalletStore.walletType != 3">Please log into the wallet holding your Centralized Assets to view details.</span>
|
||||||
|
<div @click="passportLogin">Login</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="no-data-img">
|
<div class="no-data-img">
|
||||||
<img src="@/assets/img/marketplace/Empty_state.png" alt="">
|
<img src="@/assets/img/marketplace/Empty_state.png" alt="">
|
||||||
@ -38,6 +39,7 @@ import NftId from "@/configs/item.json"
|
|||||||
import { apiHeroList } from "@/utils/marketplace"
|
import { apiHeroList } from "@/utils/marketplace"
|
||||||
import {useMarketplaceStore} from "@/store/marketplace";
|
import {useMarketplaceStore} from "@/store/marketplace";
|
||||||
import {walletStore} from "@/store/wallet";
|
import {walletStore} from "@/store/wallet";
|
||||||
|
import { BlockChain } from "@/components/chain/BlockChain"
|
||||||
const marketplaceStore = useMarketplaceStore()
|
const marketplaceStore = useMarketplaceStore()
|
||||||
const localWalletStore = walletStore()
|
const localWalletStore = walletStore()
|
||||||
const nftList = ref([])
|
const nftList = ref([])
|
||||||
@ -96,10 +98,12 @@ const getMyAssets = async () => {
|
|||||||
fields: []
|
fields: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(myADdress) {
|
const bc = new BlockChain()
|
||||||
|
if(bc.passportLogined) {
|
||||||
try {
|
try {
|
||||||
let nftListBox
|
let nftListBox
|
||||||
let res = await apiHeroList( data)
|
const ptoken = await bc.passportToken()
|
||||||
|
let res = await apiHeroList(data, ptoken)
|
||||||
// console.log(res,'----------------------')
|
// console.log(res,'----------------------')
|
||||||
// return
|
// return
|
||||||
nftList.value = [...nftList.value, ...res.rows]
|
nftList.value = [...nftList.value, ...res.rows]
|
||||||
@ -136,6 +140,10 @@ const handleScroll = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const passportLogin = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
watch(localWalletStore,() => {
|
watch(localWalletStore,() => {
|
||||||
// console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token)
|
// console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token)
|
||||||
if(!localWalletStore.token) {
|
if(!localWalletStore.token) {
|
||||||
@ -226,6 +234,16 @@ onUnmounted(() => {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
|
z-index: 99;
|
||||||
|
div {
|
||||||
|
width: 120px;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 30px;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 10px;
|
||||||
|
border: 2px solid #A767FF;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.no-data-img {
|
.no-data-img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="pages-no" v-show="nftList == undefined || nftList.length <= 0">
|
<div class="pages-no" v-show="nftList == undefined || nftList.length <= 0">
|
||||||
<div class="no-data-tips">
|
<div class="no-data-tips">
|
||||||
<span v-if="localWalletStore.walletType != 3">Please log into the wallet holding your Founder’s Tag to view details.</span>
|
<span v-if="!localWalletStore.refreshToken">Please log into the wallet holding your Centralized Assets to view details.</span>
|
||||||
|
<div @click="passportLogin">Login</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="no-data-img">
|
<div class="no-data-img">
|
||||||
<img src="@/assets/img/marketplace/Empty_state.png" alt="">
|
<img src="@/assets/img/marketplace/Empty_state.png" alt="">
|
||||||
@ -38,6 +39,7 @@ import NftId from "@/configs/item.json"
|
|||||||
import { apiAssetsState } from "@/utils/marketplace"
|
import { apiAssetsState } from "@/utils/marketplace"
|
||||||
import {useMarketplaceStore} from "@/store/marketplace";
|
import {useMarketplaceStore} from "@/store/marketplace";
|
||||||
import {walletStore} from "@/store/wallet";
|
import {walletStore} from "@/store/wallet";
|
||||||
|
import { BlockChain } from "@/components/chain/BlockChain"
|
||||||
const marketplaceStore = useMarketplaceStore()
|
const marketplaceStore = useMarketplaceStore()
|
||||||
const localWalletStore = walletStore()
|
const localWalletStore = walletStore()
|
||||||
const nftList = ref([])
|
const nftList = ref([])
|
||||||
@ -82,10 +84,12 @@ const getMyAssets = async () => {
|
|||||||
cursor: next_cursor.value,
|
cursor: next_cursor.value,
|
||||||
search_name: overviewValue.value
|
search_name: overviewValue.value
|
||||||
}
|
}
|
||||||
if(myADdress) {
|
const bc = new BlockChain()
|
||||||
|
if(bc.passportLogined) {
|
||||||
try {
|
try {
|
||||||
let nftListBox
|
let nftListBox
|
||||||
let res = await apiAssetsState(myADdress, data)
|
const ptoken = await bc.passportToken()
|
||||||
|
let res = await apiAssetsState(myADdress, data, ptoken)
|
||||||
nftList.value = [...nftList.value, ...res.rows]
|
nftList.value = [...nftList.value, ...res.rows]
|
||||||
nftListBox = nftList.value.reduce((acc, obj) => {
|
nftListBox = nftList.value.reduce((acc, obj) => {
|
||||||
const existingObj = acc.find(item => item.token_id == obj.token_id)
|
const existingObj = acc.find(item => item.token_id == obj.token_id)
|
||||||
@ -120,6 +124,11 @@ const handleScroll = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const passportLogin = async () => {
|
||||||
|
await new BlockChain().appendPassport()
|
||||||
|
getMyAssets()
|
||||||
|
}
|
||||||
|
|
||||||
watch(localWalletStore,() => {
|
watch(localWalletStore,() => {
|
||||||
// console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token)
|
// console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token)
|
||||||
if(!localWalletStore.token) {
|
if(!localWalletStore.token) {
|
||||||
@ -210,6 +219,16 @@ onUnmounted(() => {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
|
z-index: 99;
|
||||||
|
div {
|
||||||
|
width: 120px;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 30px;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 10px;
|
||||||
|
border: 2px solid #A767FF;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.no-data-img {
|
.no-data-img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -39,7 +39,6 @@ const routes = [
|
|||||||
path: "/detail",
|
path: "/detail",
|
||||||
name: "CDetail",
|
name: "CDetail",
|
||||||
component: Detail,
|
component: Detail,
|
||||||
props: true,
|
|
||||||
meta: {
|
meta: {
|
||||||
title: "Counter Fire-Detail",
|
title: "Counter Fire-Detail",
|
||||||
canonical: "https://.counterfire.games",
|
canonical: "https://.counterfire.games",
|
||||||
|
@ -55,9 +55,9 @@ export const apiGetPrice = async (data) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取我拥有得资产
|
// 获取我拥有得资产
|
||||||
export const apiAssetsState = async (account_address, data) => {
|
export const apiAssetsState = async (account_address, data, token) => {
|
||||||
const url = `${API_BASE}/api/asset/${net_id}/${account_address}`
|
const url = `${API_BASE}/api/asset/${net_id}/${account_address}`
|
||||||
return httpGet(url, data)
|
return httpGet(url, data, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取上架出售得NFTS
|
// 获取上架出售得NFTS
|
||||||
@ -73,9 +73,9 @@ export const apiHistoryState = async (account_address,data) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 账号游戏内资产
|
// 账号游戏内资产
|
||||||
export const apiLockState = async (account_address,data) => {
|
export const apiLockState = async (account_address,data, token) => {
|
||||||
const url = `${API_BASE}/api/market/product/lock/${net_id}/${account_address}`
|
const url = `${API_BASE}/api/market/product/lock/${net_id}/${account_address}`
|
||||||
return httpPost(url, data)
|
return httpPost(url, data, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
@ -120,9 +120,9 @@ export const apiCecInfo = async(address) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取游戏内资产
|
// 获取游戏内资产
|
||||||
export const apiHeroList = async(data) => {
|
export const apiHeroList = async(data, token) => {
|
||||||
const url = `${API_BASE}/api/ingame/asset/hero/list`
|
const url = `${API_BASE}/api/ingame/asset/hero/list`
|
||||||
return httpPost(url, data)
|
return httpPost(url, data, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const apiUnlockOrMint = async (data, token) => {
|
export const apiUnlockOrMint = async (data, token) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user