小程序
小游戏
企业微信
微信支付
扫描小程序码分享
手机端正常,之前老版本也是正常的,而且我也从提供的地址验证过签名是正确的
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
提供下复现路径
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
/* eslint-disable no-undef */
import { Toast } from 'zarm';
import { Fetch } from './fetch';
import loadJS from './loadJS';
export class SDK {
getWechatJSSDKConfig = async (appid) => {
const url = window.location.href.split('#')[0];
const { data: result, message, code } = await Fetch.get(
{
server: 'wx',
path: `/wxAuth/getShareSignatureV2/${appid}`,
},
true,
);
if (code != '200') {
Toast.show(message);
return;
}
const {
appId,
wxTimestamp,
wxNoncestr,
wxSignature,
// jsApiList: _jsApiList,
} = result || {};
console.log('请求配置接口成功', result);
return {
timestamp: wxTimestamp,
nonceStr: wxNoncestr,
signature: wxSignature,
};
// 微信分享
configWechatShare = async (appid) => {
// const wxOnlineDebug = config.env !== 'prd' && !!~window.location.search.indexOf('wxOnlineDebug=true');
// const wxOnlineDebug = !!~window.location.search.indexOf('wxOnlineDebug=true');
return new Promise((resolve, reject) => {
return loadJS('//res.wx.qq.com/open/js/jweixin-1.6.0.js', async () => {
// 微信授权
const result = await this.getWechatJSSDKConfig(appid);
if (!result) {
reject();
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
提供下复现路径
/* eslint-disable no-undef */
import { Toast } from 'zarm';
import { Fetch } from './fetch';
import loadJS from './loadJS';
export class SDK {
getWechatJSSDKConfig = async (appid) => {
const url = window.location.href.split('#')[0];
const { data: result, message, code } = await Fetch.get(
{
server: 'wx',
path: `/wxAuth/getShareSignatureV2/${appid}`,
},
true,
);
if (code != '200') {
Toast.show(message);
return;
}
const {
appId,
wxTimestamp,
wxNoncestr,
wxSignature,
// jsApiList: _jsApiList,
} = result || {};
console.log('请求配置接口成功', result);
return {
appId,
timestamp: wxTimestamp,
nonceStr: wxNoncestr,
signature: wxSignature,
// jsApiList: _jsApiList,
};
};
// 微信分享
configWechatShare = async (appid) => {
// const wxOnlineDebug = config.env !== 'prd' && !!~window.location.search.indexOf('wxOnlineDebug=true');
// const wxOnlineDebug = !!~window.location.search.indexOf('wxOnlineDebug=true');
return new Promise((resolve, reject) => {
return loadJS('//res.wx.qq.com/open/js/jweixin-1.6.0.js', async () => {
// 微信授权
const result = await this.getWechatJSSDKConfig(appid);
if (!result) {
reject();
}
const {