Current location - Quotes Website - Signature design - How to get the parameters of calling configuration on WeChat JS
How to get the parameters of calling configuration on WeChat JS
Read more documents

wx.config({

Debugging:? Really? //? When debugging mode is turned on, the return values of all called APIs will be displayed in client alerts. If you want to view the incoming parameters, you can open them on the pc side, and the parameter information will be typed out through the log, which will only be printed on the pc side.

appId:? '',? //? Required, the unique identification of the official account of WeChat.

Time stamp:? ,? //? Required, generate the time stamp of the signature.

Non-central: '',? //? If necessary, generate a random signature string.

Signature:? '',//? Required, signature, see appendix 1.

jsApiList:? []? //? List of required JS interfaces to be used. For a list of all JS interfaces, see Appendix 2.

}); Give you a configuration parameter object generated by php that I am using.

Function? Wechat _get_wx_config($jsApiList? =? ""){

$url? =? http://'。 $_SERVER['HTTP_HOST']。 $_SERVER['PHP_SELF']。 ($_SERVER['QUERY_STRING']'? '? . ? $_SERVER['QUERY_STRING']? :? "");

$ noncestr? =? uniqid();

$ time stamp? =? time();

$jsapi_ticket? =? $ this-& gt; Wechat _ get _ jsapi _ ticket ();

$ signature? =? sha 1(" jsapi _ ticket = $ jsapi _ ticket & amp; Noncestr = $ noncestr & timestamp = $ timestamp & url = $ url ");

Return? "{

Debugging:? Fake,

appId:? $ this-& gt; Wechat _appid',

Timestamp: $ Timestamp? ,

Non-central: $ noncestr ',

Signature:? $signature ',

jsApiList:? [$jsApiList]

}";

}