1. appId public numbers, secret get the access_token ; (To configure the current URL in the public number: js fill port security domain at the link to be tested)
Backstage visit: https:? //Api.weixin.qq.com/cgi-bin/token grant_type = client_credential & appid = "appId" & secret = "secret"
2. By the access_token , get jsapi_ticket, generating a signature, returned to the front desk;
Backstage visit: https:? //Api.weixin.qq.com/cgi-bin/ticket/getticket access_token = "access_token" & type = jsap
Generating a signature (noncestr & jsapi_ticket & timestamp & url :( except # URL back ))
3. The introduction of micro-channel front page js file, using the reference data to the backend Address: http://res.wx.qq.com/open/js/jweixin-1.2.0.js
wx.config({
debug: true, // turn on debug mode, api's all out in the return value will alert the client, to view the incoming parameters, you can open the pc side, will play parameter information through log, only the pc side calls It will be printed.
appId: '', // required, a unique identification number of the public
timestamp: data.timestamp, // required to generate a signature timestamp
nonceStr: data.nonceStr, // required to generate a random string signature
signature: data.signature, // required, signatures, see Appendix 1
jsApiList: [ 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage'] // required, the list of interfaces JS need to use all the JS interface list in Appendix 2
});