...
|
...
|
@@ -210,18 +210,6 @@ class SalesmangoodsController extends WeChatBaseController{ |
|
|
|
|
|
}
|
|
|
|
|
|
public function text(){
|
|
|
|
|
|
dump(cache('__FILE__'));
|
|
|
dump(cache('2222'));
|
|
|
dump(cache('pppp'));
|
|
|
dump(cache('ppp'));
|
|
|
dump(cache('oop'));
|
|
|
dump(cache('iip'));
|
|
|
dump(cache('uup'));
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 上传图片
|
|
|
*/
|
...
|
...
|
@@ -231,26 +219,12 @@ class SalesmangoodsController extends WeChatBaseController{ |
|
|
$filepath = $_POST['mediaId'];
|
|
|
$str = 'uploads/'.date('YmdHis').time().rand('1000000','99999999').'.png';
|
|
|
$targetName = $str;
|
|
|
cache('urll',$targetName);
|
|
|
$access_token = $access_token['accessToken'];
|
|
|
$file = file_get_contents("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");
|
|
|
cache('2222',$file);
|
|
|
cache('__FILE__',__FILE__);
|
|
|
file_put_contents($targetName,$file);
|
|
|
|
|
|
/* $ch = curl_init("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");
|
|
|
cache('pppp',$ch);
|
|
|
$fp = fopen($targetName, 'w');
|
|
|
cache('oop',111);
|
|
|
curl_setopt($ch, CURLOPT_FILE, $fp);
|
|
|
cache('iip',111);
|
|
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
cache('uup',111);
|
|
|
$msg["status"] = curl_exec($ch);*/
|
|
|
$msg["filename"] = $str;
|
|
|
/*curl_close($ch);
|
|
|
fclose($fp);*/
|
|
|
|
|
|
return json_encode($msg);
|
|
|
|
|
|
}
|
...
|
...
|
|