Browse Source

Merge pull request #306 from sarices/master

修正上传在摇一摇页面展示的图片素材接口地址错误的bug
dodge 8 years ago
parent
commit
05d57cecda
2 changed files with 14 additions and 1 deletions
  1. 13 0
      test/test-upload-shake-around-media.php
  2. 1 1
      wechat.class.php

+ 13 - 0
test/test-upload-shake-around-media.php

@@ -0,0 +1,13 @@
+<?php
+/**
+ * 微信摇一摇周边上传素材测试
+ * 
+ */
+	include("../wechat.class.php");
+
+	$options = array(
+		'appid'           => '', //填写高级调用功能的app id, 请在微信开发模式后台查询
+        'appsecret'       => '', //填写高级调用功能的密钥
+	);
+	$weObj = new Wechat($options);
+	$weObj->uploadShakeAroundMedia(array('media'=>'@'));

+ 1 - 1
wechat.class.php

@@ -3997,7 +3997,7 @@ class Wechat
      */
     public function uploadShakeAroundMedia($data){
         if (!$this->access_token && !$this->checkAuth()) return false;
-        $result = $this->http_post(self::API_URL_PREFIX.self::SHAKEAROUND_MATERIAL_ADD.'access_token='.$this->access_token,$data,true);
+        $result = $this->http_post(self::API_BASE_URL_PREFIX.self::SHAKEAROUND_MATERIAL_ADD.'access_token='.$this->access_token,$data,true);
         if ($result)
         {
             $json = json_decode($result,true);