<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ? 獲取Accesstoken ~~~php public function getAccessToken() { $appId = Config('wxinfo.appId'); $secretId = Config('wxinfo.secretId'); $accessUrl = Config('wxinfo.accessUrl'); $url = sprintf($accessUrl,$appId,$secretId); $result = https_request($url); $Result = json_decode($result,true); return $Result['access_token']; } ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "點擊并拖拽以移動") 生成二維碼: ~~~php /*分享帶參數小程序二維碼*/ public function share() { $base_url=request()->domain(); if (!input('?post.spcode')) { $ret['code'] = 400; $ret['message'] = "缺少參數,請參照接口文檔,規范傳參"; $ret['data'] = null; return json($ret); } $spcode=request()->param('spcode'); $code=Db::name('newuser')->where('spcode',$spcode)->value('qrcode'); if($code!=''){ return code(200,'獲取數據成功'.$base_url.$code); } $res=$this->getAccessToken(); $url="https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=$res"; $page= 'pages/index/index'; //TODO 這個路徑太長會報錯,所以要注意了 $processData = [ 'page'=>$page, 'scene'=> $spcode //二維碼id,二維碼類型 ]; $qrData = json_encode($processData); $data=https_request($url,$qrData); $tmp = json_decode($data,true); if($tmp['errcode'] == 45009 || $tmp['errcode'] == 41030){ return (['code' => $tmp['errcode'], 'msg' => $tmp['errmsg']]); } $filename = date('YmdHis').rand(10000,999999).'.jpg'; $dir = ROOT_PATH.'public/uploads/qr'; if(!is_dir($dir)){ @mkdir($dir,0777,true); } $file = $dir.'/'.$filename; file_put_contents($file,$data); // return $file; $retFile ='/uploads/qr/'.$filename; return request()->domain().$retFile; //到這里就可以了,后面是用來上傳到三方存儲的 // if($retFile){ // $cos=new Upload(); // $cos->upload($file,$retFile); // } // unlink('.'.$retFile); // Db::name('newuser')->where('spcode',$spcode)->update(['qrcode'=>$retFile]); return code(200,'獲取數據成功',$this->base_url.$retFile); } ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "點擊并拖拽以移動") 官方地址:?[wxacode.getUnlimited | 微信開放文檔](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.getUnlimited.html "wxacode.getUnlimited | 微信開放文檔")?方案2 微信官方文檔:[獲取小程序碼 | 微信開放文檔](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/qr-code.html "獲取小程序碼 | 微信開放文檔") ~~~php #curl請求 if(!function_exists('https_request')){ function https_request($url,$data = null){ if(function_exists('curl_init')){ $curl = curl_init(); curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION,1); if (!empty($data)){ curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); } curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($curl); curl_close($curl); return $output; }else{ return false; } } } ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "點擊并拖拽以移動") ?
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看