<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ~~~ <?php namespace app\api\controller\yunyi; use app\api\service\CutImgService; use app\api\unity\RedisCli; use app\api\unity\Uilt; use think\App; use think\admin\Controller; class Login extends Controller { /** * 獲取acc_token */ public function getAccessToken(){ $appid = 'wx946c9******'; if(!RedisCli::bulidRedis()->get('gzhAccessToken'.$appid)){ $secret = '******'; $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$appid.'&secret='.$secret; $http = new Uilt(); $data = json_decode($http->get($url),true); RedisCli::bulidRedis()->set('gzhAccessToken'.$appid,$data['access_token'],$data['expires_in']); } return RedisCli::bulidRedis()->get('gzhAccessToken'.$appid); } /** * 獲取二維碼url */ public function getQrCode(){ $key = date('dhis') . rand(10,99);; $access_token = $this->getAccessToken(); $url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=".$access_token; $postArr = array( 'expire_seconds' => 604800, //二維碼過時時間 不填默認30s 'action_name' => "QR_SCENE", //場景 'action_info' => array( 'scene' =>array('scene_id' => $key,), ), ); $postJson = json_encode($postArr); $http = new Uilt(); $res = json_decode($http->post($url,$postJson),true); if(empty($res['ticket'])) $this->error("錯誤!"); $ticket = $res['ticket']; $url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".urlencode($ticket); if(empty($url)) $this->error("錯誤!"); $data = [ 'token' => $this->encryption($key), 'url' => $url ]; $this->success('成功', $data, 200); } /** * @return void接收微信事件推送 */ public function getLoginInfo(){ $echoStr = input('echostr',''); if(!empty($echoStr)){ echo $echoStr; exit; } RedisCli::bulidRedis()->set('test12848',123,30); //接收微信服務器回調的數據流 if (!$xml = file_get_contents('php://input')) { $this->error("錯誤!"); } $data = $this->fromXml($xml); RedisCli::bulidRedis()->set('test12311',$data,300); if(!empty($data['EventKey'])){ RedisCli::bulidRedis()->set($this->encryption($data['EventKey']),$data,86400 * 7); } $toUser = $data['FromUserName']; $fromUser = $data['ToUserName']; $time = time(); $msgType = 'text'; $content = '歡迎關注我們的微信公眾賬號'; $template = "<xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <Content><![CDATA[%s]]></Content> </xml>"; $info = sprintf($template, $toUser, $fromUser, $time, $msgType, $content); echo $info; // echo 'success'; exit; } public function test1(){ $data1 = RedisCli::bulidRedis()->get('test12848'); $data = RedisCli::bulidRedis()->get('test12311'); print_r($data); print_r($data1); } /** * @return void查詢登錄狀態 */ public function getLoginStaus(){ $token = input('token'); if(!$token){ $this->error("未獲取到token!",'',101); } $data = RedisCli::bulidRedis()->get($token); if(RedisCli::bulidRedis()->get($token)){ $this->success('登錄成功', $data, 200); } $this->error("未登錄!",'',101); } /** * 將xml轉為array */ private function fromXml($xml) { // 禁止引用外部xml實體 libxml_disable_entity_loader(true); return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); } /** * 生成加密 */ private function encryption($key){ $token = ******; return $token; } } ~~~
                  <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>

                              哎呀哎呀视频在线观看