Commit 6bd96972852b79abd785976287cabbdf400715af

Authored by LesterZhao
Committed by lanrion
1 parent 1e178158
Exists in master

管理素材API bug修改 (#23)

lib/qy_wechat_api/api/material.rb
... ... @@ -24,7 +24,7 @@ module QyWechatApi
24 24 # https://qyapi.weixin.qq.com/cgi-bin/material/add_material?agentid=AGENTID&type=TYPE&access_token=ACCESS_TOKEN
25 25 def add_material(agent_id, type, file)
26 26 check_masterial_type(type)
27   - http_post("upload", {media: file}, {type: type, agentid: agent_id})
  27 + http_post("add_material", {media: file}, {type: type, agentid: agent_id})
28 28 end
29 29  
30 30 # 删除永久素材
... ...
lib/qy_wechat_api/client.rb
... ... @@ -49,6 +49,11 @@ module QyWechatApi
49 49 Api::Media.new(get_access_token)
50 50 end
51 51  
  52 + # 管理素材API
  53 + def material
  54 + Api::Material.new(get_access_token)
  55 + end
  56 +
52 57 def message
53 58 Api::Message.new(get_access_token)
54 59 end
... ...