const SMSClient = require('@alicloud/sms-sdk')const accessKeyId = 'accesskeyid'const secretAccessKey = 'secretaccessKey'let smsClient = new SMSClient({accessKeyId, secretAccessKey})let random = Math.random() * 10000000let data = { PhoneNumbers: "", SignName: "", TemplateCode: "", TemplateParam: `{ "code":${random}}`}function sendSMS(data){ return new Promise((resolve,reject)=>{ smsClient.sendSMS(data).then(res=> { let {Code}=res if (Code === 'OK') { //处理返回参数 resolve() } },err=> { reject() }) })}