亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

顯示空白,http_crul也代入了

public function http_curl($url){


? ? ? ? ? ? ? ? $ch = curl_init();


? ? ? ? ? ? ? ? curl_setopt($ch,CURLOPT_URL,$url);

? ? ? ? ? ? ? ? curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);

? ? ? ? ? ? ? ? $output = curl_exec($ch);

? ? ? ? ? ? ? ? curl_close($ch);

? ? ? ? ? ? ? ? return json_decode($output,true);

? ? ? ? ? ? ?}

//獲取用戶的openID

? ? public function getBaseInfo(){

? ? ? ? //1.獲取到code

? ? ? ? $appid="wxfbd13d9aff8a913a";

? ? ? ? $redirect_uri=urlencode("119.23.239.149/home/Login/getUserOpenId");

? ? ? ? $url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$appid."&redirect_uri=".$redirect_uri."&response_type=code&scope=snsapi_base&state=123#wechat_redirect";

header("Location:$url"); ? ?

}

? ? public function getUserOpenId(){

? ? ? ? //2.獲取到網頁授權的access_token

? ? ? ? $appid="wxfbd13d9aff8a913a";

$code=input(code);

? ? ? ? $appsecret="09d05919edad8d9cea72902bd91073de";

? $url="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appid&secret=$appsecret";

? ? ? ? $res=$this->http_curl($url);


? ? ? ? //3.拉取用戶的OPENDid

? ? }


正在回答

1 回答

請問你最后解決了嗎

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

顯示空白,http_crul也代入了

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號