fix: bugs of queryAddress
This commit is contained in:
@@ -141,7 +141,7 @@ module.exports = {
|
|||||||
const seed = parseInt(userId.substring(0, 8), 16).toString().slice(4); //前4位与Date.now前4位重复;
|
const seed = parseInt(userId.substring(0, 8), 16).toString().slice(4); //前4位与Date.now前4位重复;
|
||||||
const btc = deriveNewAccount(ROOTSECWORD, { coin: 'BTC', seed });
|
const btc = deriveNewAccount(ROOTSECWORD, { coin: 'BTC', seed });
|
||||||
const eth = deriveNewAccount(ROOTSECWORD, { coin: 'ETH', seed });
|
const eth = deriveNewAccount(ROOTSECWORD, { coin: 'ETH', seed });
|
||||||
const user = await User.findByIdAndUpdate(userId, {
|
const fund = await Fund.findOneAndUpdate({userId}, {
|
||||||
$set: {
|
$set: {
|
||||||
tokenAddress: {
|
tokenAddress: {
|
||||||
usdtBTC: btc,
|
usdtBTC: btc,
|
||||||
@@ -152,14 +152,14 @@ module.exports = {
|
|||||||
mylog.error(err);
|
mylog.error(err);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
data = user && user.tokenAddress;
|
data = fund && fund.tokenAddress;
|
||||||
}
|
}
|
||||||
return data ? res.json({
|
return data ? res.json({
|
||||||
code: 0,
|
code: 0,
|
||||||
data
|
data
|
||||||
}) : res.json({
|
}) : res.json({
|
||||||
code: 1,
|
code: 500,
|
||||||
error: res
|
msg: '系统错误'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user