超碰中文网,91久久精品日日躁夜夜躁欧美,一区二区三区精品道,一区二区国产在线观看,亚洲精品中文字幕乱码一区二区,天天看片高清影视在线观看,久久99精品久久久久蜜桃,久久成人影视

VPS參考測評推薦
專注分享VPS主機優惠信息
衡天云優惠活動
熱網互聯2026年促銷活動
hostkvm優惠促銷活動
zji優惠促銷活動
QQGNET優惠促銷活動
QQGNET優惠促銷活動

詳細說明微信官方帳戶網頁的批準說明(登錄以進行官方帳戶批準是否存在問題)

主機參考:VPS測評參考推薦/專注分享VPS服務器優惠信息!若您是商家可以在本站進行投稿,查看詳情!此外我們還提供軟文收錄、PayPal代付、廣告贊助等服務,查看詳情!
我們發布的部分優惠活動文章可能存在時效性,購買時建議在本站搜索商家名稱可查看相關文章充分了解該商家!若非中文頁面可使用Edge瀏覽器同步翻譯!PayPal代付/收錄合作

在這個移動時代,微信的公共帳戶已成為人們獲取信息并逐漸培養潛在客戶的一種方式。因此,許多程序員已改用微信發展。因此,今天我們將向您展示如何在開發微信公共帳戶的開發中實施網頁批準。

在此之前,我們提供了一個函數來自定義接口以進行請求。以下示例代碼使用請求接口請求接口:

函數是要求接口啟動請求,傳遞參數并返回接口返回的數據。 (對于此而言,代碼并不多。 curllopt_ssl_verifypeer,false);??? curl_setopt($ ch,curlopt_returntransfer,true);????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ?Error:.curl_error($ ch);????? 出口;?? } curl_close($ ch);???? 返回$ res;}

(用于文章接口由Tencent提供。 您可以參考微信公共平臺的開發人員文檔)

1。首先,您需要配置官方帳戶

1。在微信式公共帳戶可以請求用戶的網頁批準之前,開發人員必須轉到“開發- Web Services - Web帳戶- Web Fark - Web Web Authentication的配置選項。 請注意,域名(字符串)是在此處而不是在URL中輸入的。因此,請勿添加協議標題,例如http://。

2。身份驗證回調的域名配置規范是完整的域名。例如,需要網頁批準的域名是www.qq.com。配置后,此域名下的頁面都可以在http://www.qq.com/music.html和http://wwwww.qq.com/login.html上執行OAuth2.0身份驗證。 但是,http://pay.qq.com,http://music.qq.com,http://qq.com無法執行OAuth2.0 Authentication

3。第三方可以代表其官方帳戶實施網頁批準。 2。用戶同意批準和檢索代碼接口地址:https://open.weixin.qq.com/connect/oauth2/authorize?appid=Appid=Appid=Appid=Appid&recrect = ri = ri = ri = recrect_uri&resect_uri&respense_typecons_type = code = code = codecope = scope = scopecope&cpppecope =

函數get_code()//獲取代碼/condruction請求請求地址$ code_url = https://open.weixin.qq.com/connect/oauth2/authorize?appid = wechat官方帳戶appid appid appid appid Rdirect_uri =回調ressons response_type =代碼范圍= snsapi_userinfo state = state #wechat_redirect // redirect // redirect // redirect使用file_get_content()請求接口,因為您需要設置該州的回調地址。 標頭(位置:。$ code_url);退出;}

3。使用您獲得的代碼,或使用access_token和openID

接口:https://api.weixin.qq.com/sns/oauth2/oauth2/oauth2/aaccess_token2/access_token獲得的代碼 *appid或secretfunction getAccess_token($代碼)$ get_access_token_url。 $ res = http_url($ get_access_token_url);返回json_decode($ res,true);}

iv。 確定是否啟用了access_token

接口:https://api.weixin.qqc.com/sns/auth?access_token = access_token&openID&openID = OpenID = openID

/***access_token啟用函數ckeckacestoken($ access_token,$ openID)$ check_url = https://api.weixin.qqq.com/sns/auth?access_token = $$$$$??? $ result = json_decode($ res,true);??? if(isset($ result ['errmsg'])$結果['errmsg'] == 1){? appid = appid&grant_type = refresh_token&revresh_token_token = revresh_token

/*** access_token如果retieving_token無效https://api.weixin.qq.com/sns/oauth2/refresh_token? appid = appid grant_type = refresh_tokenrefferey_token = $ reFresh_token $ res = http_url($ get_refresh_token_url); return json_decode($ res,true);}

vi。獲取用戶信息

接口:https://api.weixin.qq.com/sns/userinfo?access_token = access_token&openID&openID&openID = openID&lang&lang = zh_cn

/********************************************************************************************************************************* https://api.weixin.qqc.com/sns/userinfo?access_token= $ aaccess_token openID = $ openID lang = zh_cn $ res = http_url($ get_user_info);??????????????????國家/地區:國家/地區:http://thirdwx.qlogo.cn/mmopen/g3monuztnhkdmzicilibx6iafqac56vxlsufpb6n5wksyvyvy0wksyvy0chqssyvy0chqkkiajsgqkkkiajsgqq1dzutogvlrrrrrrrrrrhjberq4emsv84e emsv84e emsv84e ,,ilege:[privilege1 privilege2],unionId:o6_bmasdasdasd6_2sgvt7hmzopfl}

完整代碼下面:

? php //第三方頁面跳躍獲取基本用戶信息//這是請求頁和代碼會話的回調頁面。 //如果要啟動會話($ _get [#39;代碼#39;])){//確定是否發送代碼。 //使用代碼獲取Access_Token和OpenID,如果(ckeckacestoken($ res [#39; access_token),$ borts#39;])== 0){//確定access_token是否有效。 //獲取用戶信息$ _session [#39; userInfo“] = $ userInfo; //在會話中保存用戶信息$ next_url =#39; http://web/web/index.php#39; //下一頁地址header(位置:。t_code();函數get_code()//獲取代碼{$ code_url = https://open.weixin.qq.com/connect/oauth2/authorize?appid=Appid=Appid=Appid=Appid=Appid redirect_uri = callback redake_type_type_type = code = code = snsapi_userininfo state = snsapi_userininfo state = state = state = wechat_echat_rediriririririr(exitect_rediririririr(exitect_rediririr) getAccess_token($ code){$ get_access_token_url = https://api.weixin.qq.com/sns/oauth2/oauth2/access_token?appid = appid = secret = secret = $ code grant_type grant_type grant_dep_type return json_decode( {$ check_url = https://api.weixin.qqc.com/sns/auth?access_token = $ aces_tokenid = $ openID $$ res = http_url($ chect_url)9; errmsg#39;] == 1){返回1; // access_token有效} else {return 0; // access_token無效 *如果獲得的access_token無效,請更新access_token函數getRefresh_token($ refresh_token){$ get_refresh_ttps_url = https://api.weixin.qucc.com/sns/sns/oauth2/re reblesh_token? appid = apphid_token_token_token_token $ res = http_url($ get_refresh_token_url);返回json_decode($ res,true); *基本用戶信息功能get_user_info($ access_token,$ openID){$ get_user_info = https://api.weixin.qq.com/sns/sns/sns/userinfo?access_token= $請求接口功能,如果$數據為空,如果$數據有一個值,則post request函數http_url($ url,$ data = null){$ ch = curl_init();_ verifypeer,false); curl_setopt($ ch,curlopt_ssl_verifyHost,0); curl_setopt($ ch,curlopt_returntransfer,true); if(!empty($ data)){curl_setopt($ ch,curlopt_post,1); curl_setopt($ ch,curlopt_postfields,$ data); $ res = curl_exec($ ch); if(curl_errno($ ch)){echo錯誤:.curl_error($ ch);出口; curl_close($ ch);返回$ res。 }

這幾篇文章你可能也喜歡:

本文由主機參考刊發,轉載請注明:詳細說明微信官方帳戶網頁的批準說明(登錄以進行官方帳戶批準是否存在問題) http://m.k2270.com/146007.html

【騰訊云】領8888元采購禮包,搶爆款云服務器 每月 9元起,個人開發者加享折上折!
打賞
轉載請注明原文鏈接:主機參考 » 詳細說明微信官方帳戶網頁的批準說明(登錄以進行官方帳戶批準是否存在問題)
主機參考僅做資料收集,不對商家任何信息及交易做信用擔保,購買前請注意風險,有交易糾紛請自行解決!請查閱:特別聲明

評論 搶沙發

評論前必須登錄!