fix: 隐藏信息

This commit is contained in:
chaosBreaking
2019-09-08 11:03:37 +08:00
parent cd63a4f5b4
commit 84d832d859
3 changed files with 12 additions and 3 deletions

View File

@@ -49,7 +49,7 @@ module.exports = {
},
async getGroup (req, res) {
const { userId } = res.locals.user;
User.find({ inviter: userId }).then(data => {
return User.find({ inviter: userId }, 'id nickname phone').then(data => {
res.json({
code: 0,
msg: 'success',
@@ -137,7 +137,7 @@ module.exports = {
},
async getGroupList (req, res) {
const { userId } = res.locals.user;
const list = await User.find({ inviter: userId }).exec();
const list = await User.find({ inviter: userId }, 'id nickname phone').exec();
return res.json({
code: 0,
data: list

View File

@@ -5,6 +5,7 @@
const axios = require('axios');
const crypto = require('./crypto');
const ethers = require('ethers');
const ethio = require('etherscan-api').init('E3ZFFAEMNN33KX4HHVUZ4KF8XY1FXMR4BI');
require('setimmediate');
@@ -36,6 +37,12 @@ class ERC20 extends ethers.Wallet {
};
return parseInt((await axios.post(ETH_NODE, queryData)).data.result);
}
static async getActions(address, contractAddress) {
let tx = await ethio.account.tokentx(address, contractAddress);
if (tx && tx.message === "OK")
return tx.result;
else return [];
}
static async getBalance(address, contractAddress) {
if (!address || !contractAddress) throw new Error('Missing params');
let queryAddress = '0x70a08231' + (address.split('x')[1]).padStart(64, '0');