zoukankan      html  css  js  c++  java
  • vue 阿里云发送短信Api

      const Core = require("@alicloud/pop-core");
    
            var client = new Core({
              accessKeyId: "xxxxxx",
              accessKeySecret: "xxxxxxx",
              endpoint: "https://dysmsapi.aliyuncs.com",
              apiVersion: "2017-05-25"
            });
    
            var params = {
              RegionId: "cn-hangzhou",
              PhoneNumbers: mobile,
              SignName: "十面埋伏", // 签名名称 公司名
              TemplateCode: "xxxxx", //   --短信模板id
              TemplateParam: "{'code':'aaaaa'}"
            };
    
            var requestOption = {
              method: "POST"
            };
    
            await client.request("SendSms", params, requestOption).then(
              result => {
                if (result.Code == "OK") {
                  this.info.result = true;
                  this.info.msg = "发送成功";
                }
                //this.ctx.body = JSON.stringify(result);
                // console.log(JSON.stringify(result));
              },
              ex => {
                this.info.result = false;
                let mobilebaid = "";
                if (mobile) {
                  mobile += ",";
                }
                mobilebaid += mobile;
                this.info.msg = "发送失败,失败号码" + mobilebaid + "其它发送成功";
                console.log(ex);
              },
              await this.dbWrite.update(BizContractSub, {
                mobile: item.mobile
              },
                {
                  sendNumber: sendNumber
                })
            );
  • 相关阅读:
    C语言II作业01
    C语言寒假大作战04
    C语言寒假大作战03
    C语言寒假大作战02
    C语言寒假大作战01
    C语言I博客作业12—学期总结
    第一次作业
    C语言I博客作业02
    C语言I博客作业11
    C语言||作业01
  • 原文地址:https://www.cnblogs.com/lvqianqian/p/12546783.html
Copyright © 2011-2022 走看看