checkAppId(); } /** * 验证状态 */ private function checkAppId() { $encrypted = $this->request->param('sign'); //aes解密 $data = aes_decrypted($encrypted); if (!$data) { throw new BaseException(['msg' => 'AES解密失败']); } if (!$app_id = $data["app_id"]) { throw new BaseException(['msg' => '缺少必要的参数:app_id']); } if (!$app_secret = $data["app_secret"]) { throw new BaseException(['msg' => '缺少必要的参数:app_secret']); } $where["app_id"] = $app_id; $open = OpenSettings::getDetail($where); if (empty($open)) { throw new BaseException(['msg' => 'app_id不存在'.$app_id]); } if ($open['app_secret'] && $open['app_secret'] != $app_secret) { throw new BaseException(['msg' => 'app_secret错误']); } $this->postData = empty($data["data"]) ? [] : $data["data"]; } }