From 5368924a12335fdf095553411cd8c2c3e27ea534 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 14 Jul 2023 13:49:08 +0800 Subject: [PATCH] 1 --- .../callback/common/SignatureService.php | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/webapp/services/callback/common/SignatureService.php b/webapp/services/callback/common/SignatureService.php index 155599d5..6529a162 100644 --- a/webapp/services/callback/common/SignatureService.php +++ b/webapp/services/callback/common/SignatureService.php @@ -4,8 +4,33 @@ namespace services; class SignatureService { - public static function web3ServiceCheck() { + const ERRCODE_SIGN = 2001; + public static function web3ServiceCheck() + { + $cbUuid = getReqVal('_cb_uuid', ''); + $row = SqlHelper::ormSelectOne( + myself()->_getMarketMysql(), + 't_callback', + array( + 'cb_uuid' => $cbUuid + ) + ); + if (!$row) { + myself()-_rspErr(self::ERRCODE); + die(); + } + } + + public static function normalMd5Sign($params, $secretKey, $excludeKeys){ + ksort($params); + $paramsStr = ''; + foreach($params as $key => $val){ + if (!in_array($key, $excludeKeys)) { + $paramsStr = $paramsStr . $key . '=' . $val . $connStr; + } + } + return md5($paramsStr . $$secretKey); } }