基于uni-id的云端一体模板
sendSmsCode() {
if(this.codeDuration) {
uni.showModal({
content: `请在${this.codeDuration}秒后重试`,
showCancel: false
})
}
if (!/^1\d{10}$/.test(this.mobile)) {
uni.showModal({
content: '手机号码填写错误111',
showCancel: false
})
return
}
const randomStr = '00000' + Math.floor(Math.random() * 1000000)
const code = randomStr.substring(randomStr.length - 6);
uniCloud.callFunction({
name: 'user-center',
data: {
action: 'sendSmsCode',
params: {
mobile: this.mobile,
templateId: '10105',
code,
type: 'login'
}
},
模板
1***@qq.com (作者)
我确定一下
2021-05-23 22:32