<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                1.根目錄下的/Application/Home/Controller文件夾中的UserController.class.php文件添加對應的方法,書寫代碼為: ~~~ <?php namespace Home\Controller; use Think\Controller; use Com\Wechat; use Com\WechatAuth; class UserController extends Controller { private $appid="wx165112bf167af76c"; private $appSecret="c65b22bfcf03fdd98504eac299701b03"; private $WechatAuth="";//初始化WechatAuth類 private $access_token="";//緩存token public function __construct(){ parent::__construct();//可能內部已經有這個構造方法了,因此加上這個 if(!session('token')){ $this->WechatAuth=new WechatAuth($this->appid,$this->appSecret);//初始化WechatAuth類 $WechatAuth=$this->WechatAuth; $token=$WechatAuth->getAccessToken(); session(array('expire'=>$token['expires_in']));//設置過期時間 session('token',$token['access_token']);//緩存token $this->access_token=$token; }else{ $token=session('token'); $this->WechatAuth=new WechatAuth($this->appid,$this->appSecret,$token);//初始化WechatAuth類 $this->access_token=$token;//緩存token } } //獲取所有用戶組 public function selectGroupsGet(){ header('Content-type:text/html;charset=utf-8;'); $WechatAuth=$this->WechatAuth; $data=$WechatAuth->groupsGet(); var_dump($data); } //創建一個分組 public function createGroup(){ header('Content-type:text/html;charset=utf-8;'); $WechatAuth=$this->WechatAuth; $data=$WechatAuth->groupsCreate('我的分組'); var_dump($data); } //查詢指定用戶的分組 public function GroupId(){ header('Content-type:text/html;charset=utf-8;'); $m=M('users'); $user=$m->find(1);//查詢users表中1d為1的數據 $openid=$user['openid']; $WechatAuth=$this->WechatAuth; $data=$WechatAuth->groupsGetid($openid); var_dump($data); } } ~~~ 2.對比上節添加或修改代碼部分 ![](https://box.kancloud.cn/9f67c863eb6bce5a0294c0dadfa31f1e_566x310.png) 3.在微信web開發者工具上測試結果為 ![](https://box.kancloud.cn/6cd8056705f42e2cac4b8860f5534d21_872x302.png) 4.本節源碼下載(下載密碼:2eee) [源碼下載](https://pan.baidu.com/s/1cMUNzYzlL8-MR196vpgofg)
                  <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>

                              哎呀哎呀视频在线观看