1 |
- import{D as c}from"./index-088a527e.js";import{w as e}from"./index-689e0a69.js";function r(o,t,a){const i=()=>{c.get("/edu-app/open/wechat/getSignature",{params:{url:window.location.href}}).then(n=>{n.code===200?s(n.data):console.log("获取微信分享签名失败")})},s=n=>{console.log(e,"wxChat"),e.config({debug:!1,appId:n.appId,timestamp:n.timestamp,nonceStr:n.nonceStr,signature:n.signature,jsApiList:["updateAppMessageShareData","updateTimelineShareData","onMenuShareAppMessage","onMenuShareTimeline"]}),e.ready(function(){console.log("wx.ready called"),e.updateAppMessageShareData({title:o,desc:t,link:window.location.href,imgUrl:a,success:function(){console.log("updateAppMessageShareData 设置成功")}}),e.onMenuShareAppMessage({title:o,desc:t,link:window.location.href,imgUrl:a,type:"link",success:function(){console.log("onMenuShareAppMessage 设置成功")},cancel:function(){}}),e.onMenuShareTimeline({title:o,link:window.location.href,imgUrl:a,success:function(){console.log("onMenuShareTimeline 设置成功")},cancel:function(){}}),e.updateTimelineShareData({title:o,link:window.location.href,imgUrl:a,success:function(){console.log("updateTimelineShareData 设置成功")}})}),e.error(function(u){})};return{getAppSignature:i}}export{r as u};
|