收藏
回答

云开发短信发送不报错,却收不到短信是什么原因?

这是我的云函数代码:
const cloud = require('wx-server-sdk')
cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV,
})
exports.main = async (event, context) => {
  try {
    const result = await cloud.openapi.cloudbase.sendSms({
        "env"'cloud1-9g3pnv3vf7c8ae07',
        "content"'验证为:'+event.code+'5分钟后失效,如非本人操作,请忽略。',
        // "sms_type": 'Notification',
        // "template_id": '10000022',
        // "template_param_list":[
          // event.code,'登录','5'
        // ],
        "phoneNumberList": [
          "+86"+event.phone
        ]
      })
    return result
  } catch (err) {
    return err
  }
}

这是日志返回代码:
code: "Ok"
isoCode: ""
message: "send success"
phoneNumber: "+8615344318330"
serialNo: "99:366760346817442773603611833"
按照开发者文档中的返回提示,这应该是发送成功了,但是不管是资源包,还是我的手机却没有接收到短信
回答关注问题邀请回答
收藏

1 个回答

  • 季夏
    季夏
    04-10
    发现问题了,在上面的代码中,result的返回是正常的,但是在微信开发者工具->云开发->运营分析->监控图表->短信监控中显示,我的短信全都发送失败了
    

    04-10
    有用
    回复
登录 后发表内容