mini program: remove secret key
This commit is contained in:
@@ -4,6 +4,9 @@ App({
|
||||
// 腾讯云物联网通信平台中获取 产品ID和设备名称
|
||||
productId: "U1BZWHF7F9", // 产品ID
|
||||
deviceName: "dev_01", // 设备名称
|
||||
// 腾讯云控制台-访问管理-访问密钥-API密钥管理中获取 SecretId, SecretKey
|
||||
secretId: "xxx",
|
||||
secretKey: "xxx",
|
||||
},
|
||||
onLaunch: function () {
|
||||
if (!wx.cloud) {
|
||||
|
@@ -30,8 +30,10 @@ Page({
|
||||
wx.cloud.callFunction({
|
||||
name: 'iothub-shadow-query',
|
||||
data: {
|
||||
productId: app.globalData.productId,
|
||||
deviceName: app.globalData.deviceName,
|
||||
ProductId: app.globalData.productId,
|
||||
DeviceName: app.globalData.deviceName,
|
||||
SecretId: app.globalData.secretId,
|
||||
SecretKey: app.globalData.secretKey,
|
||||
},
|
||||
success: res => {
|
||||
wx.showToast({
|
||||
@@ -67,9 +69,11 @@ Page({
|
||||
wx.cloud.callFunction({
|
||||
name: 'iothub-publish',
|
||||
data: {
|
||||
SecretId: app.globalData.secretId,
|
||||
SecretKey: app.globalData.secretKey,
|
||||
ProductId: app.globalData.productId,
|
||||
DeviceName: app.globalData.deviceName,
|
||||
Topic: "",
|
||||
Topic: app.globalData.productId + "/" + app.globalData.deviceName + "/data",
|
||||
Payload: payload,
|
||||
},
|
||||
success: res => {
|
||||
|
Reference in New Issue
Block a user