{"id":10,"date":"2024-09-29T10:12:21","date_gmt":"2024-09-29T02:12:21","guid":{"rendered":"https:\/\/www.bandifee.com\/?p=10"},"modified":"2025-06-09T00:39:17","modified_gmt":"2025-06-08T16:39:17","slug":"%e8%8e%b7%e5%8f%96%e6%85%a7%e6%b9%96%e9%80%9a%e4%ba%8c%e7%bb%b4%e7%a0%81","status":"publish","type":"post","link":"https:\/\/blog.bandifee.com\/index.php\/2024\/09\/29\/%e8%8e%b7%e5%8f%96%e6%85%a7%e6%b9%96%e9%80%9a%e4%ba%8c%e7%bb%b4%e7%a0%81\/","title":{"rendered":"\u83b7\u53d6\u6167\u6e56\u901a\u4e8c\u7ef4\u7801"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u539f\u7406:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u6253\u5f00\u5fae\u4fe1\u6167\u6e56\u901a\u5c0f\u7a0b\u5e8f\u65f6\u4f1a\u7ed9\u6167\u6e56\u901a\u540e\u7aef\u901a\u8fc7GET\u8bf7\u6c42\u53d1\u9001\u552f\u4e00open_id, \u7136\u540e\u8fd4\u56detoken\u503c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/files.bandifee.com\/blog\/20240929110921.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u8c03\u7528\u6167\u6e56\u901a\u7684\u751f\u6210\u4e8c\u7ef4\u7801API\u63a5\u53e3\u5c06token\u4f5c\u4e3aheader\u7684sa_token\u7684\u503c\u4f20\u5165\u540e\u53d1\u9001GET\u8bf7\u6c42, \u5373\u53ef\u5728data\u79cd\u83b7\u53d6\u5230\u4e8c\u7ef4\u7801\u7684\u5185\u5bb9\u3002\u7136\u540e\u518d\u6839\u636e\u5185\u5bb9\u751f\u6210\u4e8c\u7ef4\u7801\u5373\u53ef\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/files.bandifee.com\/blog\/20240929111157.png\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">PHP83\u5b9e\u73b0(CURL):<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>function getQrCode(&amp;$qrcode_data) : bool\n{\n    $ch = curl_init();\n    $open_id = OPENID;\n    $get_satoken_url = \"https:\/\/api.215123.cn\/web-app\/auth\/certificateLogin?openId=\".$open_id;\n    curl_setopt($ch, CURLOPT_URL, $get_satoken_url);\n    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n    try\n    {\n        $ret = curl_exec($ch);\n        $arr = json_decode($ret,true);\n        if(!isset($arr&#91;'success']) || !isset($arr&#91;'data']&#91;'token']))\n        {\n            return false;\n        }\n\n        if($arr&#91;'success'] != 'true')\n        {\n            return false;\n        }\n\n        $sa_token = $arr&#91;'data']&#91;'token'];\n        $headers = &#91;\"satoken:$sa_token\"];\n        $fee_url = \"https:\/\/api.215123.cn\/pms\/welcome\/make-qrcode\";\n        curl_setopt($ch, CURLOPT_URL, $fee_url);\n        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n        $ret = curl_exec($ch);\n        $arr = json_decode($ret,true);\n        if(!isset($arr&#91;'success']) || !isset($arr&#91;'data']))\n        {\n            return false;\n        }\n        if($arr&#91;'success'] != 'true')\n        {\n            return false;\n        }\n        $ret = $arr&#91;'data'];\n        $qrcode_data = $ret;\n        return true;\n    }\n    catch (Exception $e)\n    {\n        return false;\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u7406: \u5728\u6253\u5f00\u5fae\u4fe1\u6167\u6e56\u901a\u5c0f\u7a0b\u5e8f\u65f6\u4f1a\u7ed9\u6167\u6e56\u901a\u540e\u7aef\u901a\u8fc7GET\u8bf7\u6c42\u53d1\u9001\u552f\u4e00open_id, \u7136\u540e\u8fd4\u56detoken\u503c\u3002 \u7136\u540e\u8c03\u7528\u6167\u6e56\u901a\u7684\u751f\u6210 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[4],"tags":[2,3],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-4","tag-php","tag-3"],"_links":{"self":[{"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":12,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":40,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/posts\/10\/revisions\/40"}],"wp:attachment":[{"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bandifee.com\/index.php\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}