WeChat?? ?? ??? ????? ????? ???? ??? WeChat ?? ??? ??????...
@WeChat JSSDK ??
weixin.qq. .com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html
JSSDK ?? ??
1??: ??? ?? ???
??? ??? ???? ? ?? ?? ??? ??? ?????. ??? ?? ??? ?? 2? ??? ?? ??? ??????? ?? ? ?????? ??? ? ????.
@2??: JS ??
http://res.wx? ?????. qq.com/open /js/jweixin-1.0.0.js
????? https? ????? ?? res.wx.qq.com/open/js/jweixin-1.0.0.js
3??: ?? ?????? ?? ?? ?? ?? ??
?? ???? ?? ? ???? ? ???? ????? ????????.
wx.config({ debug: true, // 開啟調(diào)試模式,調(diào)用的所有api的返回值會在客戶端alert出來,若要查看傳入的參數(shù),可以在pc端打開,參數(shù)信息會通過log打出,僅在pc端時才會打印。 appId: '', // 必填,公眾號的唯一標(biāo)識 timestamp: , // 必填,生成簽名的時間戳 nonceStr: '', // 必填,生成簽名的隨機(jī)串 signature: '',// 必填,簽名,見附錄1 jsApiList: [] // 必填,需要使用的JS接口列表,所有JS接口列表見附錄2 });
?? 4: ??? ?????? ?? ???? ?? ??
wx.ready(function(){ // config信息驗證后會執(zhí)行ready方法,所有接口調(diào)用都必須在config接口獲得結(jié)果之后,config是一個客戶端的異步操作,所以如果需要在頁面加載時就調(diào)用相關(guān)接口,則須把相關(guān)接口放在ready函數(shù)中調(diào)用來確保正確執(zhí)行。對于用戶觸發(fā)時才調(diào)用的接口,則可以直接調(diào)用,不需要放在ready函數(shù)中。 });
5??: ?? ?????? ?? ??? ?? ??
wx.error(function(res){ // config信息驗證失敗會執(zhí)行error函數(shù),如簽名過期導(dǎo)致驗證失敗,具體錯誤信息可以打開config的debug模式查看,也可以在返回的res參數(shù)中查看,對于SPA可以在這里更新簽名。 });
?: ??? ?? ?????
wx.ready(function(){ wx.getLocation({ type: 'wgs84', // 默認(rèn)為wgs84的gps坐標(biāo),如果要返回直接給openLocation用的火星坐標(biāo),可傳入'gcj02' success: function (res) { var latitude = res.latitude; // 緯度,浮點數(shù),范圍為90 ~ -90 var longitude = res.longitude; // 經(jīng)度,浮點數(shù),范圍為180 ~ -180。 var speed = res.speed; // 速度,以米/每秒計 var accuracy = res.accuracy; // 位置精度 } }); });
??? ??? ?? ??? ? ???? ?????.
3??? ?? ?? ??:
var wxConfigJson = { debug: true, // 開啟調(diào)試模式,調(diào)用的所有api的返回值會在客戶端alert出來,若要查看傳入的參數(shù),可以在pc端打開,參數(shù)信息會通過log打出,僅在pc端時才會打印。 appId: 'wx821bb7356e99a3a7', // 必填,公眾號的唯一標(biāo)識 timestamp: 1446184841, // 必填,生成簽名的時間戳 nonceStr: '80262bec-7cd2-4b03-b366-97fab6e91cdd', // 必填,生成簽名的隨機(jī)串 signature: 'fd017d631d63cef32d5f25ea276911bcb0a29782', // 必填,簽名,見附錄1 jsApiList: ['getLocation'] // 必填,需要使用的JS接口列表,所有JS接口列表見附錄2};@Html.Raw(new WeChatJS_SDK_Config().GetConfig()) 生成上面的wxConfigJson
??? WeChatJS_SDK_Config???. ?? ? ???, funny.
1 public class WeChatJS_SDK_Config 2 { 3 private string _appId; 4 private int _timestamp ;// 必填,生成簽名的時間戳 5 private string _nonceStr ;// 必填,生成簽名的隨機(jī)串 6 private string _url; 7 private string _sign; 8 9 public WeChatJS_SDK_Config() 10 { 11 _appId = AccountConfig._appID; 12 _timestamp = Core.GetTimestamp(); 13 _nonceStr = Guid.NewGuid().ToString(); 14 _url = HttpContext.Current.Request.Url.ToString(); 15 _sign = 16 String.Format("jsapi_ticket={0}&noncestr={1}×tamp={2}&url={3}", Jsapi_Ticket.GetJsapi_Ticket(), 17 _nonceStr, _timestamp, _url).Md5Entry("sha1").ToLower(); 18 } 19 20 /* Url方法的區(qū)別 21 *@Html.Raw("var originalString='"+HttpContext.Current.Request.Url.OriginalString+"';") 22 @Html.Raw("var rawUrl='"+HttpContext.Current.Request.RawUrl+"';") 23 @Html.Raw("var url='"+HttpContext.Current.Request.Url+"';") 24 25 var originalString = 'http://xb.hnjdkj.cn:80/index/home'; 26 var rawUrl = '/index/home'; 27 var url = 'http://xb.hnjdkj.cn/index/home';*@ 28 */ 29 public string GetConfig() 30 { 31 var res = string.Format( 32 "var wxConfigJson = {{debug: {0}, appId: '{1}', timestamp: {2},nonceStr: '{3}',signature: '{4}',jsApiList: ['getLocation'] }};", Kits.AppSettings("WeChatDebug"), _appId, _timestamp, _nonceStr, _sign); 33 return res; 34 } 35 36 }
[ ?? ??】
1. WeChat ?? ?? ??? ?? ?? ????
2. WeChat ??? ???? ??? ?? ?? ????
3. 4. WeChat ??? ?? ?? ?? ?? ?? summary? ??? WeChat ?? ??(jssdk ??)? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

PHP? ? ?? ? ?? ? ?????, ?? WeChat ??? ?? ???? ?? ?? ???? ?????. ??? ?? ? ?? ??? ???? WeChat ??? PHP? ???? ???? ????. PHP? ??? ?? ???? ?? ?? ???? ?????. WeChat ???? ??? ??? ? ???? ??? ??? ???? ?? ??? ?? ??? ?????. ??? ? ??? ??? ?? ???? ?? ??? ?? ???? ??? ? ?? ????? ??? ? ? ????.

WeChat ?? ??? ??? ? ?? ??? ?? ?????. ?? ??? ????? ?? ??? ??? ??? ? ?? ?? ????, ??? ?? ? ?? ??? ?? ??? ????? ???. ? ????? PHP? ???? WeChat ?? ??? ???? ??? ?????. WeChat ?? ?? ??? ???? ?? WeChat ?? ?? ??? ??? ???. WeChat ?? ?????? WeChat ?? ??, ?? ?? ? ?? ??? ???? ??? API ??? ???? ???. PHP ??? ???? ???? ???? WeChat?? ????? ???? PH? ???? ???.

WeChat? ??? ?? ?? ? ?? ??? WeChat? ??? ??? ???? ??????. WeChat ?? ??? ??? ??? WeChat ???? ???? ??? ?? ? ?????. ??? ?? ???? ????? ??? ?????? ?? ??? ?? ??? ?? ?????. ??? WeChat ?? ??? ??? ???? ?? ?? ?????. ? ????? PHP? ???? WeChat ?? ??? ??? ???? ??? ?????. 1. ?? ?? WeChat ?? ??? ??? ????? ?? ?? ??? ???? ???. PHP WeChat ?? ??? ??? ?? ?? ?? ?? ??: Sub

WeChat? ?? ???? ?? ? ??? ??? ??? ?? ??? ? ?????. ??? ???? ??? ?? ?? ? ?? ???? WeChat ???? ???? ??? ??????. WeChat ???? ??? ? ?? ???? ??? ?????. ?? ??? ?? ?? ? ? ???? ?? WeChat ??? PHP ??? ??? ? ????. 1. PHP ?? WeChat ?? PHP? ? ?? ???? ?? ???? ?? ?? ?? ? ???? ?????. WeChat ?? ????? ???? ?? ?????? ???? PHP ??? ???? WeChat? ??? ? ????.

WeChat ?? ?? ???? ??? ?? ??? ???? ???? ? ? ???? ??? ? ??? ?? ?? ??? ?????. ? ????? PHP? ???? WeChat ??? ?? ?? ??? ???? ??? ?????. 1. WeChat ???? openid? ?????. WeChat ??? ?? ?? ??? ???? ?? ?? ???? openid? ???? ???. WeChat ?? ??? ??? ? ??? ??? ?? openid? ?? ?? ???? ?????. ??? ??? ???? ?? ??? ?? ???? ?? ? ????.

WeChat? ???? ??? ?? ? ??? ?????? ??? ???, WeChat? ??? ??? ??? ?? ??? ??? ??? ??? ?? ????. ??? ?? WeChat? ??? ????? ???? ?? ??? ??? ???? WeChat ??? ???? ?? ?? ???? ????. ? ? ?? ?? ??? ?? ?? ?????. ???? PHP ??????? ?? ??? ?? ??? ??? ???? ???? ??? ??? ?????. 1. WeChat ?? ??? ??? ?? ??? ?????. ?? ??? ?? ??? ???? ??? ?????.

PHP? ???? WeChat ?? ??? ???? ?? WeChat ?? ??? ?? ??? ?? ? ?? ??? ?? ??? ??? ????, ????? ???? ? ??? PHP? ???? WeChat ?? ??? ??? ?? ????. ? ????? PHP? ???? WeChat ?? ??? ???? ???? ??? ?????. 1??: WeChat ?? ??? ??? ??? ????. WeChat ?? ?? ??? ???? ?? WeChat ?? ??? ??? ??? ???? ???. ???? ?? ??? WeChat ?? ??? ?? ????? ?????.

???? ??? ??? ??? ???? WeChat? ?? ? ??? ???? ???? ?? ??? ?????. ?? ? ?????? ??? WeChat ??? PHP? ???? ??? ?? ???? ??? ?????. ? ????? ?? WeChat ??? PHP? ???? ??? ?? ?? ?? ???? ?? ? ? ?? ??? ?????. 1. ?? ?? ?? WeChat? ???? ?? ?? ?? ?? ??? ???? ???. ??, PHP ?? ??? WeChat ?? ???? ???? ???.
