|
@@ -86,13 +86,25 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
+ console.log('function in')
|
|
|
wx.getWeRunData({
|
|
|
success(res) {
|
|
|
console.log(res);
|
|
|
+ const { encryptedData, iv } = res
|
|
|
+ const session_key = app.globalData.wxInfo.session_key
|
|
|
+ const data = { encryptedData, iv, session_key }
|
|
|
// // 拿 encryptedData 到开发者后台解密开放数据
|
|
|
- // const encryptedData = res.encryptedData
|
|
|
- // // 或拿 cloudID 通过云调用直接获取开放数据
|
|
|
- // const cloudID = res.cloudID
|
|
|
+ wx.request({
|
|
|
+ url: `${app.globalData.publicUrl}/api/st/system/weixin/decrypt`,
|
|
|
+ method: "POST",
|
|
|
+ data,
|
|
|
+ header: {
|
|
|
+ 'x-tenant': app.globalData.tenant
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res);
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|