Vue sweep the micro-channel function calls

This function it is to bury a page number inside the public, there is a function sweep the call micro-channel js-sdk to get;

https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115  official documents

The first step binding domain, the domain name that you want to set, as well as the white list after the number to log public, going to get the call back-end, front-end do not know which ones are the white list, the domain name is much better

Part II: Installation js-sdk package (npm or yarn with the install Weixin mounting npm -js -sdk --save )

Part III: Configuring wx.config

This requires all the things inside to the back-end you, you just need to get rid of your back-end interface, the interface will return to its field wx.config inside needed (you only need to pass the url parameter on the line)

Remember that after removing the url # and #

let url = location.href.split("#")[0];
mounted () inside removed, the configuration is successful it will print successfully, you can now debug: true debug mode is on, ok is right would be better to find an error
 
 

There on the page

Click on the call scan code function

ok

***************************************************************************************************************************************************************************************************

***************************************************************************************************************************************************************************************************

 Problems encountered in moving bricks

{"errMsg":"checkJsApi:ok","checkResult":"{}"}

 

 

传了去#及后面参数的url,然后配置wx.config 就报这个错

 

 

这个错误既然在报checkJsApi:ok 那我就把它注释掉(这个就是你要用到的微信的功能扫一扫等,如用其他记得写进来)

 

 

 

去掉之后报这个错,无效的签名

 

 

 

无效的签名,https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=jsapisign

通过自己提交参数然后生成签名 看跟后端返回的签名是否一致

 

 

这个jsapi_ticket 参数后端给我

 

 

AccessToken、jsapi_ticket  微信公众号的这两个东西 一般是前端获取还是后端获取啊-------》后端获取

 

 

 

 

开发公总号 要绑定成为开发者

 

 

 

开发共总好首先肯定是授权,授权了才能拿到用户信息,如果已授权直接跳到首页,如打开开票工具(配置的地址不是我前端的首页地址,而是后端配置的地址

那个菜单配的地址是http://******wz.cn/htweb/index,它会去调微信授权哪个接口,如果没有就会弹出授权页面,点击确定授权之后重新向到前端的首页,如果已授权则直接跳前端的首页,然后---》进行业务操作)

 

 

 扫码测试就用

草料二维码--去生成二维码测试

 

Guess you like

Origin www.cnblogs.com/myfirstboke/p/11208092.html