当前位置:首页 > 技术分享

完美解决微信js-sdk在IOS系统报 wx.config报 realAuthUrl invalid signature的问题

admin4年前 (2022-04-24)技术分享5366

遇到这个问题首先是困惑,安卓可以,苹果不可以,然后查找文档,验证你们一个个尝试的结果,但是没有描述明白;

打开小程序我这边实现了原生安卓、苹果和公众号,唯独这个公众号iOS端打开小程序掉坑

总结修复问题:



App.vue中增加

 mounted:function(){
            uni.setStorage({
			        key: 'WxCodeUrl',
			        data:location.href
			    });
        },

再增加一个方法


 getSignUrl:function(){
                var signLink = ''
                var ua = navigator.userAgent.toLowerCase();
                if (/iphone|ipad|ipod/.test(ua)) {
                    signLink =uni.getStorageSync('WxCodeUrl');
                    if(!signLink)signLink = location.href
                } else {
                    signLink = location.href
                }
                return signLink;
            },

然后在需要验签的时候调用传给后台处理

app.globalData.getSignUrl()


扫描二维码推送至手机访问。

版权声明:本文由小刚刚技术博客发布,如需转载请注明出处。

本文链接:https://blog.bitefu.net/post/243.html

分享给朋友:

“完美解决微信js-sdk在IOS系统报 wx.config报 realAuthUrl invalid signature的问题” 的相关文章

微软版Ghost Win10:FFU映像备份和还原

微软版Ghost Win10:FFU映像备份和还原

在日常的维护中,系统的备份和还原是大家经常需要操作的事情。虽然Windows 10已经提供很多的工具,如系统还原、WIM备份/还原,VHD备份等。不过这些工具大多是基于文件的备份/还原。我们以前经常的使用的Ghost则是基于扇区的备份/还原…

PIP 更换国内安装源linux/windows

pip国内的一些镜像  阿里云 http://mirrors.aliyun.com/pypi/simple/   中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/   豆瓣(…

记一次阿里云服务器cc攻击防护 windows 2012 iis8

记一次阿里云服务器cc攻击防护 windows 2012 iis8

上次连续一周左右阿里云服务器都在遭受cc攻击.导致访问量特别大,节假日接口调用特别缓慢或者根本访问不了的情况.本身服务器安装了 网站安全狗(IIS版) .并开始了防cc攻击.但是呢,平时还行,这次压力山大.于是一气之下用pytho…

微软 Win11 安卓子系统已支持运行支付宝等 APK 应用(附手动侧载安装教程攻略)

微软 Win11 安卓子系统已支持运行支付宝等 APK 应用(附手动侧载安装教程攻略)

微软博客宣称,Windows 11 上 安卓子系统运行 Android  应用程序的第一个预览版现已提供给美国 Beta 频道的 Windows 内部人员。Windows 11 安卓子系统支…

centos MQTT安装和php使用mosquitto的实例

php安装mqtt  扩展yum install -y php-develyum install -y mosquitto-devel/usr/local/php/bin/pecl install Mosquitto-alpha&…

Git冲突:Please commit your changes or stash them before you merge

Git冲突:Please commit your changes or stash them before you merge

用git pull来更新代码的时候,遇到了下面的问题:error: Your local changes to the following files woul…

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。