202011-16 vue 授权获取微信openId操作 1、获取url中参数code;根据code获取openId;调用后台接口获取openId。参考文档:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842functiongetUrlKey(name){//获取url参数returndecodeURIComponent((newRegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(location.href)||[,""])[1].replace(/\+/g,'%20'))||null;}functiongetCodeApi(state){//获取codeleturlNow=encodeURICompon... 继续阅读 >