Key 和smsSecret 都正确,但发送短信一直提示
{code: 50301, errCode: "uni-id-send-sms-code-failed", errMsg: "验证码发送失败", msg: "验证码发送失败", message: "验证码发送失败"}
各位是什么问题啊??
Key 和smsSecret 都正确,但发送短信一直提示
{code: 50301, errCode: "uni-id-send-sms-code-failed", errMsg: "验证码发送失败", msg: "验证码发送失败", message: "验证码发送失败"}
各位是什么问题啊??
大明白007 (作者)
sendSmscode 换了 sendSms
报
{code: 5000, msg: "短信发送失败:错误信息:[40000] 短信发送失败,请重试"}code: 5000msg: "短信发送失败:错误信息:[40000] 短信发送失败,请重试"proto: Object "
@DCloud_云服务_JRP 我也是这个问题 {"code":50301,"errCode":"uni-id-send-sms-code-failed","errMsg":"验证码发送失败","msg":"验证码发送失败","message":"验证码发送失败"}
@DCloud_云服务_JRP {"code":50301,"errCode":"uni-id-send-sms-code-failed","errMsg":"验证码发送失败","msg":"验证码发送失败","message":"验证码发送失败"}
@DCloud_云服务_JRP 怎么解决处理哟!!
回复 DCloud_云服务_JRP:
const templateId = '我着自己的' //
if (!templateId) {
return {
code: 500,
msg: 'sendSmsCode需要传入自己的templateId,参考https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=sendsmscode'
}
}
const randomStr = '00000' + Math.floor(Math.random() * 1000000)
const code = randomStr.substring(randomStr.length - 6)
//return {mobile: params.mobile,code,type: params.type,templateId};
res = await uniID.sendSmsCode({
mobile: params.mobile,
code,
type: params.type,
templateId
})
{"code":50301,"errCode":"uni-id-send-sms-code-failed","errMsg":"验证码发送失败","msg":"验证码发送失败","message":"验证码发送失败"}
2022-06-20 16:48
回复 5***@qq.com: 文档中,这四个参数的类型要求都是String类型,你可以打印下你传的这四个参数的类型是不是string类型
2022-06-20 16:52
回复 DCloud_云服务_JRP: res = await uniID.sendSmsCode({
mobile: params.mobile+'',
code:code+'',
type: params.type+'',
templateId:templateId+''
})
2022-06-20 16:59
回复 DCloud_云服务_JRP: "event : {\"action\":\"sendSmsCode\",\"params\":{\"mobile\":\"18580238027\",\"type\":\"login\"}}" uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js:20:9
17:08:21.650 [本地调试]"[云函数:uni-id-cf] 返回结果:" {"code":50301,"errCode":"uni-id-send-sms-code-failed","errMsg":"验证码发送失败","msg":"验证码发送失败","message":"验证码发送失败"}
2022-06-20 17:09
回复 DCloud_云服务_JRP: 我已经删除了 IP 情况还是一样的
{"code":50301,"errCode":"uni-id-send-sms-code-failed","errMsg":"验证码发送失败","msg":"验证码发送失败","message":"验证码发送失败"}
2022-06-21 09:20
回复 5***@qq.com: uni-id 与 uno-id-cf 什么关系,我配置的是uni-id-cf , 发送失败,但是后台计费了???
2022-06-21 10:09
回复 5***@qq.com: uni-id-cf云函数是实现具体业务的云函数它依赖于uni-id公共模块,我在后台看你的发送状态是成功,没收到短信?
2022-06-21 10:16
回复 5***@qq.com: 运营商那边刚才没表达清楚,应该是因为号主之前投诉过此类短信,所以运营商那边给加黑了,可以换个手机号试试能不能收到
2022-06-21 14:59
大明白007 (作者)
采用的是uni-starter
2022-04-26 13:49
efficient_work
你好,我的也有这个问题,模板已经审核通过,还是报的50301,用的是1.1.32的uni-starter,麻烦看下是不是运营商的问题
2023-01-03 16:56
DCloud_云服务_JRP
回复 efficient_work: 私信发一下模板编号给我看下
2023-01-03 17:21
efficient_work
回复 DCloud_云服务_JRP: 发了,你看下私信
2023-01-03 17:38