Skip to content

Commit

Permalink
修改win平台二维码打开方式,需要测试
Browse files Browse the repository at this point in the history
  • Loading branch information
lbbniu committed Oct 17, 2016
1 parent 89607e7 commit 2482072
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions WebWeiXin.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function getUUID(){
}

public function genQRCode(){
if(false&&strpos(PHP_OS, 'win')!==false){
if(PHP_OS !='Darwin'&&strpos(PHP_OS, 'win')!==false){
$this->_showQRCodeImg();
}else{
$this->_str2qr('https://login.weixin.qq.com/l/' . $this->uuid);
Expand All @@ -137,7 +137,7 @@ public function _showQRCodeImg(){
$QRCODE_PATH = $this->_saveFile('qrcode.jpg', $data, '_showQRCodeImg');
//os.startfile(QRCODE_PATH)
//TODO:没有完成

system($QRCODE_PATH);
}

public function waitForLogin($tip=1){
Expand Down Expand Up @@ -1064,8 +1064,10 @@ public function _safe_open($path){
if ($this->autoOpen){
if(PHP_OS == "Linux"){
system(sprintf("xdg-open %s &" , $path));
}else{
}elseif(PHP_OS == "Darwin"){
system(sprintf('open %s &' , $path));
}else{
system($path);
}
}
}
Expand Down Expand Up @@ -1127,7 +1129,7 @@ public function _transcoding($data){
if (gettype($data) == 'unicode'){
$result = $data;
}elseif(gettype($data) == 'string'){
$result = $data;//.decode('utf-8');
$result = $data;
}
return $result;
}
Expand Down

0 comments on commit 2482072

Please sign in to comment.