From c175ac09a9369eb05540300ebc42b13def36c185 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 24 Feb 2022 11:29:21 +0800 Subject: [PATCH] 1 --- doc/Market.py | 2 ++ webapp/controller/MarketController.class.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/Market.py b/doc/Market.py index 2b568bc3..112f6745 100644 --- a/doc/Market.py +++ b/doc/Market.py @@ -13,10 +13,12 @@ class Market(object): 'url': 'webapp/index.php?c=Market&a=getNonce', 'params': [ ['account', '', '钱包账号'], + ['token', '', 'token'], ['net_id', '', '网络id'], ], 'response': [ _common.RspHead(), + ['state', 0, '0:token无效客户端需签名 1:token是有效的客户端不需要再次签名'], ['nonce', '', 'nonce'], ] }, diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 92952f87..9a3beba2 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -485,9 +485,12 @@ class MarketController extends BaseController { public function getNonce() { + $account = getReqVal('account', ''); + $token = getReqVal('token', ''); $nonce = myself()->_getNowTime(); myself()->_rspData(array( - 'nonce' => $nonce + 'state' => $this->isValidToken($account, $token) ? 1 : 0, + 'nonce' => $nonce, )); }