作者 王晓刚
1 个管道 的构建 通过 耗费 1 秒

上传图片

@@ -240,9 +240,10 @@ class SalesmangoodsController extends WeChatBaseController{ @@ -240,9 +240,10 @@ class SalesmangoodsController extends WeChatBaseController{
240 $str = 'uploads/'.date('YmdHis').time().rand('1000000','99999999').'.png'; 240 $str = 'uploads/'.date('YmdHis').time().rand('1000000','99999999').'.png';
241 $targetName = $str; 241 $targetName = $str;
242 $access_token = $access_token['accessToken']; 242 $access_token = $access_token['accessToken'];
243 - $file = file_get_contents("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath"); 243 + $url = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath";
  244 +// $file = file_get_contents("http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=$access_token&media_id=$filepath");
  245 + $file = $this->httpGet($url);
244 file_put_contents($targetName,$file); 246 file_put_contents($targetName,$file);
245 -// $msg["filename"] = cmf_get_image_url($str);  
246 $msg["filename"] = '/'.$str; 247 $msg["filename"] = '/'.$str;
247 return json_encode($msg); 248 return json_encode($msg);
248 249