Skip to content

Commit

Permalink
update operation module in back-end server
Browse files Browse the repository at this point in the history
add voting function
  • Loading branch information
Cha0s0000 committed Apr 27, 2018
1 parent 2c29ac4 commit 6f60061
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions NodeServer/api/operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ router.get('/wif_is_valid', function(req, res) {
});
});

router.get('/vote',function(req,res){
var voter= req.query.voter;
var author= req.query.author;
var permlink= req.query.permlink;
var weight= +(req.query.weight);
var wif = aesDecrypt(req.query.key,key,iv);
steem.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) {
if(!err){
res.json({message:'success'});
console.log('vote success');
}else{
res.json({message:'fail'});
console.log('vote fail');
}
});



});


const aesDecrypt = function(data, secretKey, iv) {
const cipherEncoding = 'hex'
Expand Down

0 comments on commit 6f60061

Please sign in to comment.