This commit is contained in:
aozhiwei 2024-07-17 17:33:01 +08:00
parent fb6218418c
commit b6847d6b20
4 changed files with 10 additions and 4 deletions

View File

@ -49,6 +49,7 @@ function getItemMetaNftType(itemMeta) {
function getNftTableName(tokenType) {
switch (Number(tokenType)) {
case bcconst.BC_NFT_HERO:
case bcconst.BC_NFT_NORMAL_HERO:
{
return 't_hero';
}

View File

@ -114,7 +114,11 @@ async function verify(session) {
console.log('fffff', err, decoded);
if (err != null) {
//console.log(postData);
session.rspErr(500, err);
if (err instanceof jwt.TokenExpiredError) {
session.rspErr(501, 'jwt expired');
} else {
session.rspErr(500, err);
}
return;
}
session.rspData({

View File

@ -46,7 +46,8 @@ async function mintHero(session) {
session.rspErr(101, 'nft_address param error2');
return;
}
if (!(toAddress == heroAddress || toAddress == normalHeroAddress)) {
console.log(toAddress, heroAddress, normalHeroAddress);
if (!(nftAddress == heroAddress || nftAddress == normalHeroAddress)) {
session.rspErr(500, 'nft_address is not hero or normalhero address');
return;
}
@ -76,7 +77,7 @@ async function mintHero(session) {
]);
const nonce = transId;
const nftList = [];
tokenids.forEach(ele => {
tokenIds.forEach(ele => {
nftList.push([
ele,
toAddress,

View File

@ -76,7 +76,7 @@ async function nftUnlock(session) {
]);
const nonce = transId;
const nftList = [];
tokenids.forEach(ele => {
tokenIds.forEach(ele => {
nftList.push([
ele,
toAddress,