From 58999ddc2492178a23b0f334934dc6eb661051c9 Mon Sep 17 00:00:00 2001 From: Chaim Date: Sat, 18 Jul 2020 11:58:36 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96Api=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E8=A7=A3=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 ++++- src/ApiController.php | 8 +++----- src/common.php | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39179bb..e934276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ -## v6.0.97 / 2020-07-18 +## v6.0.92 / 2020-07-18 +- 优化Api加密解密 + +## v6.0.91 / 2020-07-18 - 修复请求门面手机设备类型 ## v6.0.90 / 2020-07-18 diff --git a/src/ApiController.php b/src/ApiController.php index 6c19886..55afbe3 100644 --- a/src/ApiController.php +++ b/src/ApiController.php @@ -193,9 +193,8 @@ class ApiController extends stdClass /** * 验证接口签名 - * @param string $name */ - public function _judgeSign($name = 'sniff_h5') + public function _judgeSign() { // 加密的数据参数 $aes = $this->request->post('aes', ''); @@ -209,7 +208,7 @@ class ApiController extends stdClass $this->error('数据异常!', 105); } // 解密 - $aes_decode = $this->decrypt($aes, $name, $timestamp); + $aes_decode = $this->decrypt($aes, $timestamp); if (empty($aes_decode)) { $this->error('解密失败', 106); } @@ -247,11 +246,10 @@ class ApiController extends stdClass /** * 解密 * @param string $data - * @param string $name * @param int $timestamp * @return bool|false|string */ - private function decrypt(string $data, string $name, int $timestamp) + private function decrypt(string $data, int $timestamp) { if (empty($this->aes_md5)) { $this->setAesMd5(); diff --git a/src/common.php b/src/common.php index 3d10061..31e9f5e 100644 --- a/src/common.php +++ b/src/common.php @@ -28,7 +28,7 @@ use think\db\exception\ModelNotFoundException; /** * 定义当前版本 */ -const VERSION = '6.0.91'; +const VERSION = '6.0.92'; if (!function_exists('get_ip_info')) { /** -- GitLab