npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

apis-aliyun

v1.1.4

Published

aliyun api for koa2, made by windsome.feng, including alidayu, sts, vod

Downloads

11

Readme

apis-aliyun NPM version Build Status Dependencies Status Coverage Status

精简版阿里云接口(使用fetch)

  1. 调用阿里大于发送短信
    阿里大于管理端:https://dysms.console.aliyun.com/dysms.htm?spm=5176.2020520153.aliyun_topbar.129.20034945K9sQJK#/overview
    阿里大于短信服务文档:https://help.aliyun.com/product/44282.html?spm=5176.sms-account.102.8.fa111cbep1BX5w
  2. sts用于上传视频文件的临时授权

功能列表

  • 发送短信验证码接口
  • 其他接口

Installation

$ npm install apis-aliyun --save

Usage

阿里大于短信用法: 需要import相应的库:import { dayu } from 'apis-aliyun';import * as dayu from 'apis-aliyun/lib/dayu'
代码参考:阿里大于短信发送参考代码

备注:一般建议在koa2或node端使用,注意accessKeySecret是私密信息,不能暴露。
参数含义:

  1. SignName,必选,字符串类型,短信签名,一般为企业简称。如:云通信。
  2. PhoneNumbers,必选,字符串类型,短信接收号码。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式。如:13661234567
  3. TemplateCode,必选,字符串类型,短信模板ID。可以到阿里云控制台去申请。如:SMS_0000
  4. TemplateParam,可选, JSON类型,短信模板变量替换JSON串,友情提示:如果JSON中需要带换行符,请参照标准的JSON协议要求。如:{“code”:”1234”,”product”:”ytx”}
  5. OutId,可选,字符串类型,外部流水扩展字段,一般忽略此字段。

使用方法

  1. 到阿里云平台中找到短信服务,申请接入。 阿里大于的短信验证码服务已经并入阿里云,通过阿里云的控制台->产品与服务->短信服务(在D字头中)进入。
  2. 申请短信签名和短信模板 直接按照阿里云提示的步骤操作
  3. 等待审核通过。
  4. 找到自己的accessKeyId和accessKeySecret,如果没有则去创建。可以通过右上角,个人信息图标中的accessKeys进去。
  5. 按usage节方法使用

Show cases

艺术品挖宝 http://mp.zdili.com

公众号演示,搜索 "帝利文化"

交流群

nodejs开发QQ群: 573207886

捐赠

License

The MIT license.

Contributors

备注

  1. 错误 InvalidTimeStamp.Expired,原因为时区问题,Timestamp应该用0时区。
错误返回:
{
  Message: 'Specified time stamp or date value is expired.',
  RequestId: 'E6CAD98D-E5DD-486B-BE35-9A32AE001666',
  HostId: 'dysmsapi.aliyuncs.com',
  Code: 'InvalidTimeStamp.Expired' 
}

修改:
    let timestamp = moment().format ("YYYY-MM-DD HH:mm:ss");
为:
    let timestamp = moment().utc().format ("YYYY-MM-DD HH:mm:ss");
  1. 错误 SignatureDoesNotMatch
错误返回:
{
  Message: 'Specified signature is not matched with our calculation.',
  RequestId: 'ABAD35BD-CBF6-4EF4-9D70-98C9DA303646',
  HostId: 'dysmsapi.aliyuncs.com',
  Code: 'SignatureDoesNotMatch' 
}
修改:
        let strToSign = arr.map(key => {
            //return encodeURIComponent(key +"="+ nArgs[key]);
            return encodeURIComponent(key) +"="+ encodeURIComponent(nArgs[key]);
        }).join('&');
*        strToSign = "GET&%2F&"+strToSign;
为:
        let strToSign = arr.map(key => {
            //return encodeURIComponent(key +"="+ nArgs[key]);
            return encodeURIComponent(key) +"="+ encodeURIComponent(nArgs[key]);
        }).join('&');
*        strToSign = "GET&%2F&"+encodeURIComponent(strToSign);
  1. 正确返回
{
  Message: 'OK',
  RequestId: '0DDA1848-A16C-4910-AD37-1E04828F8ECF',
  BizId: '108638754257^1111626164850',
  Code: 'OK' 
}