|
@@ -42,6 +42,12 @@ proto.route = function (pathname) {
|
|
|
switch (pathname) {
|
|
switch (pathname) {
|
|
|
//case '/withdrawstart.nd': return (query, method, res) => this.withdrawstartAsync(query, method, res);//充值开始
|
|
//case '/withdrawstart.nd': return (query, method, res) => this.withdrawstartAsync(query, method, res);//充值开始
|
|
|
case '/clear.nd': return (query, method, res) => this.clearAsync(query, method, res);//充值开始
|
|
case '/clear.nd': return (query, method, res) => this.clearAsync(query, method, res);//充值开始
|
|
|
|
|
+ case '/checkUser': return (query, method, res) => this.checkUserAsync(query, method, res);//充值开始
|
|
|
|
|
+ case '/queryBalance': return (query, method, res) => this.queryBalanceAsync(query, method, res);//充值开始
|
|
|
|
|
+ case '/deductUsdt': return (query, method, res) => this.deductUsdtAsync(query, method, res);//充值开始
|
|
|
|
|
+ case '/addUsdt': return (query, method, res) => this.addUsdtAsync(query, method, res);//充值开始
|
|
|
|
|
+ case '/refundUsdt': return (query, method, res) => this.refundUsdtAsync(query, method, res);//充值开始
|
|
|
|
|
+ case '/hoodleToUsdt.nd': return (query, method, res) => this.hoodleToUsdtAsync(query, method, res);//充值开始
|
|
|
//case '/taskRecord.nd': return (query, method, res) => this.taskRecordAsync(query, method, res);//充值开始
|
|
//case '/taskRecord.nd': return (query, method, res) => this.taskRecordAsync(query, method, res);//充值开始
|
|
|
//case '/withdrawrecord.nd': return (query, method, res) => this.withdrawRecordAsync(query, method, res);//充值开始
|
|
//case '/withdrawrecord.nd': return (query, method, res) => this.withdrawRecordAsync(query, method, res);//充值开始
|
|
|
///case '/sgjrecord.nd': return (query, method, res) => this.sgjRecordAsync(query, method, res);//充值开始
|
|
///case '/sgjrecord.nd': return (query, method, res) => this.sgjRecordAsync(query, method, res);//充值开始
|
|
@@ -590,6 +596,369 @@ proto.payOkAsync = P.coroutine(function* (query, method, res) {
|
|
|
//return this.payDiamondAsync(playerId, out_trade_no, total_fee, res);
|
|
//return this.payDiamondAsync(playerId, out_trade_no, total_fee, res);
|
|
|
return this.payUsdtAsync(query,res);
|
|
return this.payUsdtAsync(query,res);
|
|
|
});
|
|
});
|
|
|
|
|
+proto.checkUserAsync = P.coroutine(function* (query, method, res){var response = {}
|
|
|
|
|
+ response.code = 200
|
|
|
|
|
+ response.message = ""
|
|
|
|
|
+ console.warn("checkUserAsync query:",query)
|
|
|
|
|
+ var app_key = query["app_key"]
|
|
|
|
|
+ if (!app_key) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (app_key != "pm7OoaSJXL2j6UMnWifVN5I0") {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var userid = query["user_id"]
|
|
|
|
|
+ if (!userid) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var token = query["token"]
|
|
|
|
|
+ if (!token) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "token invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!checkFishUSDTSign(query)) {
|
|
|
|
|
+ response.code = 403
|
|
|
|
|
+ response.message = "sign error"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var players = yield this.app.models.Player.findMongoAsync({ userId: Number(userid) });
|
|
|
|
|
+ if (players.length == 0) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var player = players[0]
|
|
|
|
|
+ if (player._id != token) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "token invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ response.usdt = players[0].diamond
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+})
|
|
|
|
|
+proto.queryBalanceAsync = P.coroutine(function* (query, method, res){var response = {}
|
|
|
|
|
+ response.code = 200
|
|
|
|
|
+ response.message = ""
|
|
|
|
|
+ console.warn("queryBalanceAsync query:",query)
|
|
|
|
|
+ var app_key = query["app_key"]
|
|
|
|
|
+ if (!app_key) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (app_key != "pm7OoaSJXL2j6UMnWifVN5I0") {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var userid = query["user_id"]
|
|
|
|
|
+ if (!userid) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!checkFishUSDTSign(query)) {
|
|
|
|
|
+ response.code = 403
|
|
|
|
|
+ response.message = "sign error"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var players = yield this.app.models.Player.findMongoAsync({ userId: Number(userid) });
|
|
|
|
|
+ if (players.length == 0) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var player = players[0]
|
|
|
|
|
+ response.usdt = players[0].diamond
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+proto.deductUsdtAsync = P.coroutine(function* (query, method, res){var response = {}
|
|
|
|
|
+ response.code = 200
|
|
|
|
|
+ response.message = ""
|
|
|
|
|
+ console.warn("deductUsdtAsync query:",query)
|
|
|
|
|
+ var app_key = query["app_key"]
|
|
|
|
|
+ if (!app_key) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (app_key != "pm7OoaSJXL2j6UMnWifVN5I0") {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var userid = query["user_id"]
|
|
|
|
|
+ if (!userid) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var trade_no = query["trade_no"]
|
|
|
|
|
+ if (!trade_no) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "trade_no invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var usdt_amount = query["usdt_amount"]
|
|
|
|
|
+ if (!usdt_amount || usdt_amount == 0) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "token invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!checkFishUSDTSign(query)) {
|
|
|
|
|
+ response.code = 403
|
|
|
|
|
+ response.message = "sign error"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var players = yield this.app.models.Player.findMongoAsync({ userId: Number(userid) });
|
|
|
|
|
+ if (players.length == 0) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var player = players[0]
|
|
|
|
|
+ if (usdt_amount > player.diamond){
|
|
|
|
|
+ response.code = 402
|
|
|
|
|
+ response.message = "insufficient balance"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var self = this
|
|
|
|
|
+ var app = this.app
|
|
|
|
|
+ return app.memdb.goose.transactionAsync(P.coroutine(function* () {
|
|
|
|
|
+ var records = yield app.models.FishUSDTRecord.findMongoAsync({ trade_no: trade_no });
|
|
|
|
|
+ if (records.length > 0) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "already exist"
|
|
|
|
|
+ return self.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var record = new app.models.FishUSDTRecord({
|
|
|
|
|
+ _id: uuid.v1(), // 订单号
|
|
|
|
|
+ userId: userid,
|
|
|
|
|
+ trade_no: trade_no,
|
|
|
|
|
+ dSource: player.diamond,
|
|
|
|
|
+ dSwap: 0-usdt_amount,
|
|
|
|
|
+ dNow:player.diamond - usdt_amount,
|
|
|
|
|
+ timestamp: Date.now(),
|
|
|
|
|
+ });
|
|
|
|
|
+ player.diamond -= usdt_amount
|
|
|
|
|
+ response.usdt = player.diamond
|
|
|
|
|
+ var diamondrecord = new app.models.DiamondRecord({
|
|
|
|
|
+ _id: uuid.v1(),
|
|
|
|
|
+ playerId: player._id,
|
|
|
|
|
+ dType: 25,//withdraw fail
|
|
|
|
|
+ dSource: player.diamon ,
|
|
|
|
|
+ dSwap: 0-usdt_amount,
|
|
|
|
|
+ dNow: player.diamond - usdt_amount,
|
|
|
|
|
+ tableId: -amount
|
|
|
|
|
+ });
|
|
|
|
|
+ yield diamondrecord.saveAsync()
|
|
|
|
|
+ yield record.saveAsync()
|
|
|
|
|
+ yield player.saveAsync()
|
|
|
|
|
+ return self.writeOut(response, res);
|
|
|
|
|
+ }), app.getServerId())
|
|
|
|
|
+ .then(() => app.event.emit('transactionSuccess'), () => app.event.emit('transactionFail'));
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+proto.addUsdtAsync = P.coroutine(function* (query, method, res){var response = {}
|
|
|
|
|
+ response.code = 200
|
|
|
|
|
+ response.message = ""
|
|
|
|
|
+ console.warn("addUsdtAsync query:",query)
|
|
|
|
|
+ var app_key = query["app_key"]
|
|
|
|
|
+ if (!app_key) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (app_key != "pm7OoaSJXL2j6UMnWifVN5I0") {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var userid = query["user_id"]
|
|
|
|
|
+ if (!userid) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var trade_no = query["trade_no"]
|
|
|
|
|
+ if (!trade_no) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "trade_no invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var usdt_amount = query["usdt_amount"]
|
|
|
|
|
+ if (!usdt_amount || usdt_amount == 0) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "token invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!checkFishUSDTSign(query)) {
|
|
|
|
|
+ response.code = 403
|
|
|
|
|
+ response.message = "sign error"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var players = yield this.app.models.Player.findMongoAsync({ userId: Number(userid) });
|
|
|
|
|
+ if (players.length == 0) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var player = players[0]
|
|
|
|
|
+ var self = this
|
|
|
|
|
+ var app = this.app
|
|
|
|
|
+ return app.memdb.goose.transactionAsync(P.coroutine(function* () {
|
|
|
|
|
+ var records = yield app.models.FishUSDTRecord.findMongoAsync({ trade_no: trade_no });
|
|
|
|
|
+ if (records.length > 0) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "already exist"
|
|
|
|
|
+ return self.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var record = new app.models.FishUSDTRecord({
|
|
|
|
|
+ _id: uuid.v1(), // 订单号
|
|
|
|
|
+ userId: userid,
|
|
|
|
|
+ trade_no: trade_no,
|
|
|
|
|
+ dSource: player.diamond,
|
|
|
|
|
+ dSwap: usdt_amount,
|
|
|
|
|
+ dNow:player.diamond + usdt_amount,
|
|
|
|
|
+ timestamp: Date.now(),
|
|
|
|
|
+ });
|
|
|
|
|
+ player.diamond += usdt_amount
|
|
|
|
|
+ response.usdt = player.diamond
|
|
|
|
|
+ var diamondrecord = new app.models.DiamondRecord({
|
|
|
|
|
+ _id: uuid.v1(),
|
|
|
|
|
+ playerId: player._id,
|
|
|
|
|
+ dType: 26,//withdraw fail
|
|
|
|
|
+ dSource: player.diamond,
|
|
|
|
|
+ dSwap: usdt_amount,
|
|
|
|
|
+ dNow: player.diamond + usdt_amount,
|
|
|
|
|
+ tableId: -amount
|
|
|
|
|
+ });
|
|
|
|
|
+ yield diamondrecord.saveAsync()
|
|
|
|
|
+ yield record.saveAsync()
|
|
|
|
|
+ yield player.saveAsync()
|
|
|
|
|
+ return self.writeOut(response, res);
|
|
|
|
|
+ }), app.getServerId())
|
|
|
|
|
+ .then(() => app.event.emit('transactionSuccess'), () => app.event.emit('transactionFail'));
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+proto.refundUsdtAsync = P.coroutine(function* (query, method, res){var response = {}
|
|
|
|
|
+ response.code = 200
|
|
|
|
|
+ response.message = ""
|
|
|
|
|
+ console.warn("refundUsdtAsync query:",query)
|
|
|
|
|
+ var app_key = query["app_key"]
|
|
|
|
|
+ if (!app_key) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (app_key != "pm7OoaSJXL2j6UMnWifVN5I0") {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var userid = query["user_id"]
|
|
|
|
|
+ if (!userid) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var trade_no = query["trade_no"]
|
|
|
|
|
+ if (!trade_no) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "trade_no invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var origin_trade_no = query["origin_trade_no"]
|
|
|
|
|
+ if (!origin_trade_no) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "origin_trade_no invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var usdt_amount = query["usdt_amount"]
|
|
|
|
|
+ if (!usdt_amount || usdt_amount == 0) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "token invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!checkFishUSDTSign(query)) {
|
|
|
|
|
+ response.code = 403
|
|
|
|
|
+ response.message = "sign error"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var players = yield this.app.models.Player.findMongoAsync({ userId: Number(userid) });
|
|
|
|
|
+ if (players.length == 0) {
|
|
|
|
|
+ response.code = "1"
|
|
|
|
|
+ response.message = "param is wrong"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var player = players[0]
|
|
|
|
|
+ if (player._id != token) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "token invalid"
|
|
|
|
|
+ return this.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var self = this
|
|
|
|
|
+ var app = this.app
|
|
|
|
|
+ return app.memdb.goose.transactionAsync(P.coroutine(function* () {
|
|
|
|
|
+ var records = yield this.app.models.FishUSDTRecord.findMongoAsync({ trade_no: origin_trade_no });
|
|
|
|
|
+ if (records.length == 0 ) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "trade_no not exist"
|
|
|
|
|
+ return self.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var record = records[0]
|
|
|
|
|
+ if (records[0].is_refund == 1 ) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "trade_no already refund"
|
|
|
|
|
+ return self.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (record.dSwap + usdt_amount != 0) {
|
|
|
|
|
+ response.code = 401
|
|
|
|
|
+ response.message = "trade_no not exist"
|
|
|
|
|
+ return self.writeOut(response, res);
|
|
|
|
|
+ }
|
|
|
|
|
+ var fishRefundRecord = new app.models.FishRefundUSDTRecord({
|
|
|
|
|
+ _id: uuid.v1(), // 订单号
|
|
|
|
|
+ userId: userid,
|
|
|
|
|
+ trade_no: trade_no,
|
|
|
|
|
+ origin_trade_no:origin_trade_no,
|
|
|
|
|
+ dSource: player.diamond,
|
|
|
|
|
+ dSwap: usdt_amount,
|
|
|
|
|
+ dNow:player.diamond + usdt_amount,
|
|
|
|
|
+ timestamp: Date.now(),
|
|
|
|
|
+ });
|
|
|
|
|
+ var diamondrecord = new app.models.DiamondRecord({
|
|
|
|
|
+ _id: uuid.v1(),
|
|
|
|
|
+ playerId: player._id,
|
|
|
|
|
+ dType: 27,//withdraw fail
|
|
|
|
|
+ dSource: player.diamon ,
|
|
|
|
|
+ dSwap: usdt_amount,
|
|
|
|
|
+ dNow: player.diamond + usdt_amount,
|
|
|
|
|
+ tableId: -amount
|
|
|
|
|
+ });
|
|
|
|
|
+ yield diamondrecord.saveAsync()
|
|
|
|
|
+ player.diamond += usdt_amount
|
|
|
|
|
+ response.usdt = player.diamond
|
|
|
|
|
+ yield fishRefundRecord.saveAsync()
|
|
|
|
|
+ yield player.saveAsync()
|
|
|
|
|
+ return self.writeOut(response, res);
|
|
|
|
|
+ }), app.getServerId())
|
|
|
|
|
+ .then(() => app.event.emit('transactionSuccess'), () => app.event.emit('transactionFail'));
|
|
|
|
|
+
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
|
|
|
proto.withdrawstartAsync = P.coroutine(function* (query, method, res){
|
|
proto.withdrawstartAsync = P.coroutine(function* (query, method, res){
|
|
|
var response = {}
|
|
var response = {}
|
|
@@ -1012,6 +1381,36 @@ function checkUSDTSign(query) {
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+function checkFishUSDTSign(query) {
|
|
|
|
|
+ var sortedKeys = Object.keys(query)
|
|
|
|
|
+ .filter(function(key) {
|
|
|
|
|
+ if (key == 'hash') {
|
|
|
|
|
+ return query[key].length > 0
|
|
|
|
|
+ }// 替换箭头函数为 function 声明
|
|
|
|
|
+ return key !== 'sign'; // 跳过 sign 参数
|
|
|
|
|
+ })
|
|
|
|
|
+ .sort();
|
|
|
|
|
+ // 3. 拼接键值对(替换箭头函数)
|
|
|
|
|
+ var queryStr = sortedKeys
|
|
|
|
|
+ .map(function(key) {
|
|
|
|
|
+ if (key=='hash' && query[key]=='') {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ var value = (query[key] === undefined || query[key] === null) ? '' : String(query[key]);
|
|
|
|
|
+ return key + '=' + value; // 避免模板字符串,用字符串拼接更兼容
|
|
|
|
|
+ })
|
|
|
|
|
+ .join('&');
|
|
|
|
|
+ var signKey = md5(queryStr+"&key=TGv4NBh80V7JbED39xyjX6PdsWnHZK2tcpAueFMm").toLowerCase();
|
|
|
|
|
+ console.warn("queryStr:",queryStr)
|
|
|
|
|
+ console.warn("signKey:",signKey)
|
|
|
|
|
+ var sign = query["sign"]
|
|
|
|
|
+ console.warn("sign:",sign)
|
|
|
|
|
+ if (sign!=signKey) return false;
|
|
|
|
|
+ return true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
proto.withdrawRecordAsync = P.coroutine(function* (query, method, res) {
|
|
proto.withdrawRecordAsync = P.coroutine(function* (query, method, res) {
|
|
|
var userid = query["userid"]
|
|
var userid = query["userid"]
|
|
|
var limit = query["limit"]
|
|
var limit = query["limit"]
|
|
@@ -1149,9 +1548,9 @@ proto.payRecordAsync = P.coroutine(function* (query, method, res) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//if (!checkUSDTSign(query)) {
|
|
//if (!checkUSDTSign(query)) {
|
|
|
- //response.code = "1"
|
|
|
|
|
- //response.message = "验证签名错误"
|
|
|
|
|
- //return this.writeOut(response, res);
|
|
|
|
|
|
|
+ //response.code = "1"
|
|
|
|
|
+ //response.message = "验证签名错误"
|
|
|
|
|
+ //return this.writeOut(response, res);
|
|
|
//}
|
|
//}
|
|
|
if (!page) {
|
|
if (!page) {
|
|
|
page = 0
|
|
page = 0
|