From 293b30cb65f9d5fb6e818475ef0e55d257d750d0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 7 Jun 2023 15:07:31 +0800 Subject: [PATCH] 1 --- webapp/controller/BaseAuthedController.class.php | 9 ++++++++- webapp/controller/BlockChainController.class.php | 3 +-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 7323e755..77cade55 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -165,10 +165,17 @@ class BaseAuthedController extends BaseController { return phpcommon\extractChannel($this->_getAccountId()); } - public function _getAddress(){ + public function _getAddress() + { return $this->_getOpenId(); } + public function _isValidAddress() + { + $address = $this->_getAddress(); + return !empty($address); + } + public function _getSessionId() { return $this->sessionId; diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index ecf3fdc7..ee5995d0 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -36,8 +36,7 @@ class BlockChainController extends BaseAuthedController { public function _handlePre() { parent::_handlePre(); - if (getReqVal('a', '') != 'getTransactionList' && - myself()->_getChannel() != BC_CHANNEL) { + if (getReqVal('a', '') != 'getTransactionList' && !myself()->_isValidAddress()) { die(json_encode(array( 'errcode' => 501, 'errmsg' => 'you are not a wallet user'