H5页面分享到群,提示操作过于频繁
发布于 5 年前 作者 taomin 12508 次浏览 来自 问答

操作方式:

微信内直接打开H5页面:http://man.39.net/slbp/share.html

右上角->分享给朋友,然后选择群。

则出现以下提示:操作过于频繁,可稍候再试。

页面代码如下:

var api39_wx = function(config) {
            if (navigator.userAgent.match(/MicroMessenger/i)) {
                $.ajax({
                    tyep: "get",
                    url: "http://xxxxxxxxxx/GetConfigParameter",
                    dataType: "jsonp",
                    jsonp: "jsoncallback",
                    data: {
                        urlback: encodeURIComponent(location.href.split("#")[0])
                    },
                    success: function(data) {
                        wx.config({
                            debug: false,
                            appId: data.strappid,
                            timestamp: data.strtimestamp,
                            nonceStr: data.strnoncestr,
                            signature: data.strsignature,
                            jsApiList: ["onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareQQ", "onMenuShareQZone"]
                        });
                        wx.ready(function() {
                            if(wx.onMenuShareAppMessage) {
                                wx.onMenuShareAppMessage(config);
                                wx.onMenuShareQQ(config);
                            }
                            else {
                                wx.updateTimelineShareData(config,function(res){
                                });
                            }
                            if(wx.onMenuShareTimeline) {
                                wx.onMenuShareTimeline(config);
                                wx.onMenuShareQZone(config);
                            }
                            else {
                                wx.updateAppMessageShareData(config,function(res){
                                });
                            }
                        });
                    }
                })
            }
        };
        var wxinfo = new api39_wx({
            title: '自定义分享标题出来了',
            desc: '这里是自定义分享的摘要',
            link: location.href,
            imgUrl: 'http://nimage.39.net/wap/m/images/pic/for_weixin.jpg',
        });

如果去掉这段代码,则可以分享到群,但分享标题、链接、缩略图均为微信自动获取。

2 回复

同样的jsonp获取签名 但是在真机上jsonp回调不管是成功还是失败都不执行,一脸懵逼,开发者工具是正常的

请问找到问题了吗

回到顶部