Skip to content

Commit

Permalink
因在基础接口上的冲突问题,采用浏览器控制台输出并不是一个好的方法,暂时去掉,再想新的方法。
Browse files Browse the repository at this point in the history
  • Loading branch information
abei2017 committed Jun 12, 2018
1 parent 09b1d6e commit 294db6e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 21 deletions.
5 changes: 0 additions & 5 deletions src/core/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,5 @@ protected function post($url,$params = [], $headers = [], $options = []){
return $this->httpClient->post($url,$params,$headers,$options);
}

protected function console($content){
if(isset($this->conf['console']) && $this->conf['console'] === true){
Util::outConsole($content);
}
}

}
7 changes: 0 additions & 7 deletions src/helpers/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,4 @@ static public function makeSign($params,$key){
return strtoupper(md5($str));
}

static public function outConsole($content){

$time = date("Y-m-d H:i:s");
$consoleString = "【abei2017/yii2-wx】 ".$time." ".$content;

echo "<script>console.log('".$consoleString."');</script>";
}
}
1 change: 0 additions & 1 deletion src/mp/core/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function getValidIps(){
$access = new AccessToken(['conf'=>$this->conf,'httpClient'=>$this->httpClient]);
$accessToken = $access->getToken();

$this->console("Base助手和微信服务器通讯开始 ".__FILE__." ".__LINE__."");
$response = $this->get(self::API_BASE_IP_URL,['access_token'=>$accessToken])->send();

$data = $response->getData();
Expand Down
8 changes: 0 additions & 8 deletions src/mp/qrcode/Qrcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ public function init()
* @return array
*/
public function intTemp($seconds = 2592000,$val){
$this->console("生成临时二维码(数字类),有效期为{$seconds}".__FILE__." ".__LINE__."");
return $this->temp('QR_SCENE',$seconds,['scene_id'=>$val]);
}

public function strTemp($seconds = 2592000,$val){
$this->console("生成临时二维码(字符串类),有效期为{$seconds}".__FILE__." ".__LINE__."");
return $this->temp('QR_STR_SCENE',$seconds,['scene_str'=>$val]);
}

Expand All @@ -66,7 +64,6 @@ private function temp($action = 'QR_SCENE', $seconds = 2592000, $scene = ['scene

$params = array_merge(['expire_seconds'=>$seconds,'action_name'=>$action,'action_info'=>['scene'=>$scene]]);

$this->console("Qrcode助手和微信服务器开始通讯 ".__FILE__." ".__LINE__."");
$response = $this->post(Qrcode::API_QRCODE_URL."?access_token={$this->accessToken}",$params)
->setFormat(Client::FORMAT_JSON)->send();

Expand All @@ -77,7 +74,6 @@ private function temp($action = 'QR_SCENE', $seconds = 2592000, $scene = ['scene
$response->setFormat(Client::FORMAT_JSON);
$data = $response->getData();

$this->console("Qrcode助手和微信服务器通讯完毕 ".Json::encode($data)." ".__FILE__." ".__LINE__."");
if(isset($data['errcode'])){
throw new Exception("{$data['errcode']}#{$data['errmsg']}");
}
Expand All @@ -91,7 +87,6 @@ private function temp($action = 'QR_SCENE', $seconds = 2592000, $scene = ['scene
* @return mixed
*/
public function intForver($val){
$this->console("生成永久二维码(数字类) ".__FILE__." ".__LINE__."");
return $this->forver('QR_LIMIT_SCENE',['scene_id'=>$val]);
}

Expand All @@ -101,7 +96,6 @@ public function intForver($val){
* @return mixed
*/
public function strForver($val){
$this->console("生成永久二维码(字符串类) ".__FILE__." ".__LINE__."");
return $this->forver('QR_LIMIT_STR_SCENE',['scene_str'=>$val]);
}

Expand All @@ -114,7 +108,6 @@ public function strForver($val){
private function forver($action = 'QR_LIMIT_SCENE', $scene = ['scene_id'=>0]){
$params = array_merge(['action_name'=>$action,'action_info'=>['scene'=>$scene]]);

$this->console("Qrcode助手和微信服务器通讯开始 ".__FILE__." ".__LINE__."");
$response = $this->post(Qrcode::API_QRCODE_URL."?access_token={$this->accessToken}",$params)
->setFormat(Client::FORMAT_JSON)->send();

Expand All @@ -127,7 +120,6 @@ private function forver($action = 'QR_LIMIT_SCENE', $scene = ['scene_id'=>0]){
$response->setFormat(Client::FORMAT_JSON);
$data = $response->getData();

$this->console("Qrcode助手和微信服务器通讯完毕 ".Json::encode($data)." ".__FILE__." ".__LINE__."");
if(isset($data['errcode'])){
throw new Exception($data['errmsg'],$data['errcode']);
}
Expand Down

0 comments on commit 294db6e

Please sign in to comment.