From a01e0ef5b9173f80ea339dff746bf798eb12cc9e Mon Sep 17 00:00:00 2001 From: Donny Date: Thu, 12 Apr 2018 08:46:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0version=E4=B8=8Elocale?= =?UTF-8?q?=E4=BC=A0=E5=85=A5AbstractApi=E5=AF=B9=E8=B1=A1=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Core/Api/AbstractApi.php | 7 +++++++ src/Core/Api/ApiService.php | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/Core/Api/AbstractApi.php b/src/Core/Api/AbstractApi.php index e0af24e..46cb776 100644 --- a/src/Core/Api/AbstractApi.php +++ b/src/Core/Api/AbstractApi.php @@ -57,6 +57,7 @@ abstract class AbstractApi extends AbstractService protected $_accessToken; protected $_version; + protected $_locale; /** * 对accessToken的等级要求 @@ -99,6 +100,12 @@ public function getVersion(){ public function setVersion($v){ $this->_version = $v; } + public function getLocale(){ + return $this->_locale; + } + public function setLocale($v){ + $this->_locale = $v; + } /** * 设置AccessToken diff --git a/src/Core/Api/ApiService.php b/src/Core/Api/ApiService.php index 9012bad..06e8f61 100644 --- a/src/Core/Api/ApiService.php +++ b/src/Core/Api/ApiService.php @@ -362,6 +362,8 @@ static public function invoke($req) $params = $req->getParams(); $appKey = $req->getAppKey(); $accessToken = $req->getAccessToken(); + $version = $req->getVersion(); + $locale = $req->getLocale(); //读取可用方法 self::_fetchValidMethod(); $apiConfigData = self::_parseRequestApiMethod($method); @@ -405,6 +407,8 @@ static public function invoke($req) $modObj->setAccessTokenRequiredLevel($level); $modObj->initParams($validParams, $method); $modObj->setAppKey($appKey); + $modObj->setVersion($version); + $modObj->setLocale($locale); self::$apiLoggerService->setAccessMemberId( self::$invokeId, $modObj->getUserMemberId() );