html52.com
我爱小程序-开发者交流社区

msg_sec_check返回{}空值问题?

问题模块 框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
API和组件 小程序 Bug msg_sec_check 客户端 7.0.4 2.7.2

- 当前 Bug 的表现(可附上截图)

- 当前 Bug 的表现(可附上截图)- 预期表现


- 预期表现

云调用成功,但result的数据为空。

- 复现路径

onClose(event) {
    if (event.detail === 'confirm') {
      // 异步关闭弹窗
      setTimeout(() => {
        wx.cloud.init({ env: 'mindiao-44343' })
        wx.cloud.callFunction({
          name: 'word',
          data: {
            text: this.data.newzhuti
          }
        }).then(res => {
          console.log(res);

}

}

……

- 提供一个最简复现 Demo

云函数是这个:


// 云函数入口文件
const cloud = require('wx-server-sdk')
 
cloud.init({
  env: 'mindiao-6311b9'
})
 
// 云函数入口函数
exports.main = async (event, context) => {
 
  try {
    var result = await cloud.openapi.security.msgSecCheck({
      content: event.text
    })
    return (result)
  } catch (err) {
    return err
  }
}


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付