const uidObj = require('uni-id');
const res = await uidObj.sendSmsCode({
...this.ctx.data,
code: Math.floor(Math.random() * 1000000) + "",
//templateId:"30516"
templateId: uidObj.config['service']['smscode']['templateId'] //发送验证码
});
小杜1212
- 发布:2024-04-15 12:28
- 更新:2024-06-17 16:52
- 阅读:141
产品分类: uniCloud/App
操作步骤:
预期结果:
短信发送成功
短信发送成功
实际结果:
code: "INVOKE_FUNCTION_FAILED"
message: "Cannot read property 'service' of undefined"
code: "INVOKE_FUNCTION_FAILED"
message: "Cannot read property 'service' of undefined"
bug描述:
const uidObj = require('uni-id');
const res = await uidObj.sendSmsCode({
...this.ctx.data,
code: Math.floor(Math.random() * 1000000) + "",
//templateId:"30516"
templateId: uidObj.config['service']['smscode']['templateId'] //发送验证码
});
这是发送手机短信验证码的,当uni-id版本为3.3.31是,出现的错误是Cannot read property 'service' of undefined,给templateId直接赋值是运行是正常的。当uni-id版本改为3.1.0,原代码运行正常,其他版本的uni-id都运行不了
1 个回复
s***@163.com
mark下