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) { function getNftTableName(tokenType) {
switch (Number(tokenType)) { switch (Number(tokenType)) {
case bcconst.BC_NFT_HERO: case bcconst.BC_NFT_HERO:
case bcconst.BC_NFT_NORMAL_HERO:
{ {
return 't_hero'; return 't_hero';
} }

View File

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

View File

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

View File

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