# Cloud.getJSSDKSignature(options: Object): Promise<Object>

支持端:Web 1.1.0

web 中使用 SDK 登录之后可用此方法获取用于 wx.config 的 JSSDK 签名

# 参数

# options: Object

属性 类型 默认值 必填 说明
url string 要签名的网页 URL

# 返回值

# Promise.<Object>

result

属性 类型 说明
timestamp number 时间戳,wx.config 需用
nonceStr string 随机串,wx.config 需用
signature string 签名,wx.config 需用

# 示例代码

const res = await cloud.getJSSDKSignature({
  url: '要签名的网页 URL'
})

wx.config({
  appId: '公众号 AppID', // 必填,公众号的唯一标识
  timestamp: res.timestamp + '', // 必填,生成签名的时间戳
  nonceStr: res.nonceStr, // 必填,生成签名的随机串
  signature: res.signature,// 必填,签名
  jsApiList: ['JS API 名'] // 必填,需要使用的JS接口列表
})