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 btc = deriveNewAccount(ROOTSECWORD, { coin: 'BTC', seed });
|
||||
const eth = deriveNewAccount(ROOTSECWORD, { coin: 'ETH', seed });
|
||||
const user = await User.findByIdAndUpdate(userId, {
|
||||
const fund = await Fund.findOneAndUpdate({userId}, {
|
||||
$set: {
|
||||
tokenAddress: {
|
||||
usdtBTC: btc,
|
||||
@@ -152,14 +152,14 @@ module.exports = {
|
||||
mylog.error(err);
|
||||
return null;
|
||||
});
|
||||
data = user && user.tokenAddress;
|
||||
data = fund && fund.tokenAddress;
|
||||
}
|
||||
return data ? res.json({
|
||||
code: 0,
|
||||
data
|
||||
}) : res.json({
|
||||
code: 1,
|
||||
error: res
|
||||
code: 500,
|
||||
msg: '系统错误'
|
||||
});
|
||||
};
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user