{"id":28824,"date":"2020-02-09T04:47:23","date_gmt":"2020-02-08T20:47:23","guid":{"rendered":"http:\/\/4563.org\/?p=28824"},"modified":"2020-02-09T04:47:23","modified_gmt":"2020-02-08T20:47:23","slug":"%e5%85%8d%e8%b4%b9%e6%b7%98%e5%ae%9d%e5%ae%a2%e8%bd%ac%e9%93%beapi-%e9%99%84php%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=28824","title":{"rendered":"\u514d\u8d39\u6dd8\u5b9d\u5ba2\u8f6c\u94feapi&#8212;&#8211;\u9644PHP\u4ee3\u7801"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>amo<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:34:09\t<\/p>\n<h3>\u514d\u8d39\u6dd8\u5b9d\u5ba2\u8f6c\u94feapi&#8212;&#8211;\u9644PHP\u4ee3\u7801<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 amo \u4e8e 2020-1-4 16:42 \u7f16\u8f91 <\/p>\n<p> \u7f51\u4e0a\u5f88\u591a\u8f6c\u94fe\u90fd\u662f\u8981\u6536\u8d39\u7684\uff0c\u50cf\u4ec0\u4e48\u7ef4\u4ec0\u4e48\u768468 \u5143\/\u6708\uff0c668 \u5143\/\u5e74\u3002\u3002\u771f\u662f\u62a2\u94b1\u554a<br \/>  \u800c\u5b98\u65b9\u7684\u8f6c\u94fe\u4e00\u822c\u4eba\u6ca1\u6709\u6743\u9650\u4f7f\u7528\u4e0d\u4e86\uff0c\u662f\u9080\u8bf7\u673a\u5236\u5f00\u901a\u7684<br \/>  \u800c\u5927\u6dd8\u5ba2\u63d0\u4f9b\u4e86\u514d\u8d39\u7684\u8f6c\u94fe\u63a5\u53e3\uff0c\u76f4\u63a5\u5728\u5927\u6dd8\u5ba2api\u65b0\u5efa\u5e94\u7528\uff0c\u7ed1\u5b9a\u4e09\u6bb5\u5f0fpid\uff1a mm_0_0_0\uff08\u8fd9\u4e2a\u4e0d\u77e5\u9053\u5c31\u4e0d\u8981\u73a9\u4e86\uff09\u3002\u7136\u540e\u52a0\u5165\u5e94\u7528\u91cc\u5c31\u53ef\u4ee5\u7528\u4e86<br \/>  php\u4ee3\u7801\u5982\u4e0b\uff1a\u6211\u8fd9\u4e2a\u4ee3\u7801\u7528get\u6216\u8005post\u8f6c\u5165\u6dd8\u5b9d\u5546\u54c1ID\u5373\u53ef\u81ea\u52a8\u8df3\u8f6c\u5230\u9ad8\u4f63\u9886\u5238\u9875\u9762<\/p>\n<p>  &lt;?php<br \/>  \/\/\u8f6c\u94fe<br \/>  header(&quot;Content-Type: text\/html;charset=utf-8&quot;);<br \/>  error_reporting(0);<br \/>  $id=$_REQUEST[&#8216;id&#8217;];<br \/>  function makeSign($datas, $appSecret)<br \/>  {<br \/>  &nbsp; &nbsp; ksort($datas);<br \/>  &nbsp; &nbsp; $str = &#8221;;<br \/>  &nbsp; &nbsp; foreach ($datas as $k =&gt; $v) {<\/p>\n<p>  &nbsp; &nbsp;&nbsp; &nbsp;$str .= &#8216;&amp;&#8217; . $k . &#8216;=&#8217; . $v;<br \/>  &nbsp; &nbsp; }<br \/>  &nbsp; &nbsp; $str = trim($str, &#8216;&amp;&#8217;);<br \/>  &nbsp; &nbsp; $sign = strtoupper(md5($str . &#8216;&amp;key=&#8217; . $appSecret));<br \/>  &nbsp; &nbsp; return $sign;<br \/>  }<\/p>\n<p>   function zl($id){<\/p>\n<p>  $hosts = &#8216;https:\/\/openapi.dataoke.com\/api\/tb-service\/get-privilege-link&#8217;;<br \/>  $appKey = &#8216;***********&#8217;;\/\/\u5e94\u7528\u7684key<br \/>  $appSecret = &#8216;***********************&#8217;;\/\/\u5e94\u7528\u7684Secret<br \/>  \/\/\u9ed8\u8ba4\u5fc5\u4f20\u53c2\u6570<\/p>\n<p>  $datas = [<\/p>\n<p>  &nbsp; &nbsp; &#8216;appKey&#8217; =&gt; $appKey,<br \/>  &nbsp; &nbsp; &#8216;version&#8217; =&gt; &#8216;v1.1.1&#8217;,<br \/>  &nbsp; &nbsp; &#8216;goodsId&#8217; =&gt; $id,\/\/<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; <br \/>  ];<\/p>\n<p>  $datas[&#8216;sign&#8217;] = makeSign($datas,$appSecret);<br \/>  $urls = $hosts .&#8217;?&#8217;. http_build_query($datas);<br \/>  &nbsp; &nbsp; $curl = curl_init();<br \/>  &nbsp; &nbsp; curl_setopt($curl, CURLOPT_URL, $urls);<br \/>  &nbsp; &nbsp; curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);<br \/>  &nbsp; &nbsp; curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\/\/ https\u8bf7\u6c42\u4e0d\u9a8c\u8bc1\u8bc1\u4e66\u548chosts<br \/>  &nbsp; &nbsp; curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);<br \/>  &nbsp; &nbsp; $res=json_decode(curl_exec($curl),true);<br \/>  &nbsp; &nbsp; curl_close($curl);<br \/>  $z[] =$res[&#8216;data&#8217;][&#8216;couponInfo&#8217;];\/\/\u4f18\u60e0\u5238\u9762\u989d<br \/>  $z[] =$res[&#8216;data&#8217;][&#8216;shortUrl&#8217;];\/\/\u9ad8\u4f63\u94fe\u63a5<br \/>  return $z;<br \/>   }<br \/>   list($couponInfo,$shortUrl) = zl($id);<br \/>  header(&quot;Location: {$shortUrl}&quot;);<br \/>  exit;<br \/>  ?&gt;<\/p>\n<p>  \u6709\u7528\u7684\u670b\u53cb\u62ff\u53bb\u5427\uff01\u5982\u679c\u53ea\u8981\u8df3\u8f6c\u5230\u94fe\u63a5\u4e0a\u9762\u7684\u4ee3\u7801\u53ef\u4ee5\u4fee\u6539\u4e0b\u5c31\u884c\u4e86  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Mr.<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:46:01\t<\/p>\n<h3><\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 Mr. \u4e8e 2020-1-4 16:54 \u7f16\u8f91 <\/p>\n<p> amo \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:38<br \/>  \u4e00\u822c\u4eba\u6ca1\u6709\u6743\u9650\u7684\u3002\u3002\u3002\u6211\u7684\u6dd8\u5b9d\u5ba2\u7f51\u7ad9\u5c31\u6ca1\u6709\u6743\u9650\u3002<br \/>  \u800c\u4e14\u8fd9\u4e2a\u6743\u9650\u662f\u9080\u8bf7\u5f00\u901a\uff0c\u4e5f\u4e0d\u80fd\u7533\u8bf7<br \/>  \u8981\u4e0d\u7136\u4ed6\u8fd9\u4e2a\u548b &#8230;<\/p>\n<p>  \u4e0d\u61c2\u2026 \u6211\u7684\u6dd8\u5ba2\u53f7\u662f\u53bb\u5e74\u4e0b\u534a\u5e74\u624d\u641e\u7684\uff0c\u81ea\u5df1\u5f00\u53d1\u4e86\u51e0\u5957\u7a0b\u5e8f\uff0c\u8fd9\u4e2a\u9700\u6c42\u90fd\u662f\u8d70\u5b98\u65b9\u63a5\u53e3\u7684\u2026 \u4e5f\u6ca1\u88ab\u4ec0\u4e48\u6743\u9650\u5361\u8fc7\u2026<br \/>  \u4e24\u4e2a\u9700\u8981\u8d70\u522b\u4eba\u63a5\u53e3\u7684\uff0c\u4e00\u4e2a\u662f\u6dd8\u53e3\u4ee4\u89e3\u6790\uff0c\u4e00\u4e2a\u662f\u8ba2\u5355\u67e5\u8be2\u2026 \u86cb\u75bc\u2026<\/p>\n<p>  \u8c01\u7279\u4e48\u8fd8\u7ed9\u70b9\u4e86\u4e2a\u53cd\u5bf9\uff0c\u8ba8\u8bba\u95ee\u9898\u90fd\u4e0d\u884c\uff1f\u6211\u8bf4\u7684\u90fd\u662f\u81ea\u5df1\u7684\u771f\u5b9e\u60c5\u51b5\uff0c\u4f60\u6709\u8d28\u7591\u5c31\u51fa\u6765\u8ba8\u8bba\u554a\uff0c\u9ebb\u75f9\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>wangjianjilei<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:36:47\t<\/p>\n<h3><\/h3>\n<p>  \t\tgood~~\u6536\u85cf\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Mr.<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:37:54\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u8fd9\u63a5\u53e3\u5b98\u65b9\u4e0d\u662f\u6709\u5417\u2026 \u4e3a\u5565\u8981\u7528\u5927\u6dd8\u5ba2\u7684\u2026\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>amo<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:38:56\t<\/p>\n<h3><\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 amo \u4e8e 2020-1-4 16:40 \u7f16\u8f91 <\/p>\n<p> Mr. \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:37<br \/>  \u8fd9\u63a5\u53e3\u5b98\u65b9\u4e0d\u662f\u6709\u5417\u2026 \u4e3a\u5565\u8981\u7528\u5927\u6dd8\u5ba2\u7684\u2026<\/p>\n<p>  \u4e00\u822c\u4eba\u6ca1\u6709\u6743\u9650\u7684\u3002\u3002\u3002\u6211\u7684\u6dd8\u5b9d\u5ba2\u7f51\u7ad9\u5c31\u6ca1\u6709\u6743\u9650\u3002<br \/>  \u800c\u4e14\u8fd9\u4e2a\u6743\u9650\u662f\u9080\u8bf7\u5f00\u901a\uff0c\u4e5f\u4e0d\u80fd\u7533\u8bf7<br \/>  \u8981\u4e0d\u7136\u4ed6\u8fd9\u4e2a\u548b\u6562\u62ff\u53bb\u5356http:\/\/wsd.591hufu.com\/price\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>amo<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:48:05\t<\/p>\n<h3><\/h3>\n<p>  \t\tMr. \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:46<br \/>  \u4e0d\u61c2\u2026 \u6211\u7684\u6dd8\u5ba2\u53f7\u662f\u53bb\u5e74\u4e0b\u534a\u5e74\u624d\u641e\u7684\uff0c\u81ea\u5df1\u5f00\u53d1\u4e86\u51e0\u5957\u7a0b\u5e8f\uff0c\u8fd9\u4e2a\u9700\u6c42\u90fd\u662f\u8d70\u5b98\u65b9\u63a5\u53e3\u7684\u2026 \u4e5f\u6ca1\u88ab\u4ec0\u4e48\u6743\u9650 &#8230;<\/p>\n<p> \u6dd8\u5ba2\u81ea\u5e26\u7684\u5217\u8868\uff0c\u63a8\u8350\u4ec0\u4e48\u7684\u5df2\u7ecf\u81ea\u52a8\u8f6c\u94fe \u4e0d\u9700\u8981\u518d\u5355\u72ec\u8f6c\u94fe\u4e86<br \/>  \u6709\u4e9bapi\u53ea\u80fd\u67e5\u5230\u5546\u54c1id\uff0c\u8f6c\u94fe\u9700\u8981\u5355\u72ecapi\u641e\uff0c\u6211\u7684api\u8fd9\u4e2a\u6b63\u597d\u6ca1\u6709\u6743\u9650\uff0c\u6240\u4ee5\u5c31\u73a9\u4e86\u8fd9\u4e2a\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>hkvip8<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:50:45\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5df2\u7ecf\u6536\u85cf\u4e86\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Mr.<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:51:11\t<\/p>\n<h3><\/h3>\n<p>  \t\tamo \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:48<br \/>  \u6dd8\u5ba2\u81ea\u5e26\u7684\u5217\u8868\uff0c\u63a8\u8350\u4ec0\u4e48\u7684\u5df2\u7ecf\u81ea\u52a8\u8f6c\u94fe \u4e0d\u9700\u8981\u518d\u5355\u72ec\u8f6c\u94fe\u4e86<br \/>  \u6709\u4e9bapi\u53ea\u80fd\u67e5\u5230\u5546\u54c1id\uff0c\u8f6c\u94fe\u9700\u8981\u5355\u72ecapi\u641e &#8230;<\/p>\n<p> \u4f60\u53ef\u4ee5\u5148\u7528 taobao.tbk.item.info.get \u8fd9\u4e2a\u63a5\u53e3\u83b7\u5f97\u5546\u54c1\u94fe\u63a5\uff0c\u7136\u540e\u628a\u5546\u54c1\u94fe\u63a5\u653e\u5230 taobao.tbk.dg.material.optional \u8fd9\u4e2a\u63a5\u53e3\u7684 q \u53c2\u6570\u67e5\u8be2<\/p>\n<p>  \u7b2c\u4e8c\u4e2a\u63a5\u53e3\u67e5\u51fa\u6765\u7684\u5c31\u5e26\u6709\u5238\u548c\u5546\u54c1\u7684\u8fd4\u5229\u94fe\u63a5\u4e86\uff0c\u4f60\u770b\u770b\u8fd9\u4e24\u4e2a\u63a5\u53e3\u4f60\u6709\u6ca1\u6709\u6743\u9650\uff08\u7b2c\u4e8c\u4e2a\u597d\u50cf\u9700\u8981\u540e\u53f0\u7533\u8bf7\u4e00\u4e0b \u79d2\u8fc7\u90a3\u79cd\uff09<\/p>\n<p>  \u53ef\u80fd\u6211\u6709\u6d01\u7656\uff0c\u80fd\u4e0d\u7528\u522b\u4eba\u7684\u63a5\u53e3\u5c31\u5c3d\u91cf\u4e0d\u7528\uff0c\u4e4b\u524d\u7528 kouss \u7684\u63a5\u53e3 \u7ed3\u679c\u6709\u4e00\u6b21\u4ed6\u63a5\u53e3\u6302\u4e86\u51e0\u4e2a\u5c0f\u65f6\u2026\u2026\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>ncnc<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 17:01:57\t<\/p>\n<h3><\/h3>\n<p>  \t\t\u80fd\u4e0d\u80fd\u628a\u522b\u4eba\u94fe\u63a5\u548c\u6dd8\u53e3\u4ee4 \u6279\u91cf\u8f6c\u6210\u81ea\u5df1\u7684\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>fondy<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 17:04:02\t<\/p>\n<h3><\/h3>\n<p>  \t\tMr. \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-1-4 16:51<br \/>  \u4f60\u53ef\u4ee5\u5148\u7528 taobao.tbk.item.info.get \u8fd9\u4e2a\u63a5\u53e3\u83b7\u5f97\u5546\u54c1\u94fe\u63a5\uff0c\u7136\u540e\u628a\u5546\u54c1\u94fe\u63a5\u653e\u5230 taobao.tbk.dg.materia &#8230;<\/p>\n<p> \u5b66\u4e60\u5b66\u4e60\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>amo \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/28824"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28824"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/28824\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28824"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}