Giter Site home page Giter Site logo

依托答辩,我就想用accessToken,https调一个API,看了半天阿里云文档看不出个所以然,阿里云泰酷辣 about alibabacloud-typescript-sdk HOT 9 OPEN

Ccheng2729111 avatar Ccheng2729111 commented on May 20, 2024 10
依托答辩,我就想用accessToken,https调一个API,看了半天阿里云文档看不出个所以然,阿里云泰酷辣

from alibabacloud-typescript-sdk.

Comments (9)

tolerious avatar tolerious commented on May 20, 2024 3
const { default: Dysmsapi20170525 } = require("@alicloud/dysmsapi20170525");
const { Config } = require("@alicloud/openapi-client");
const { default: Credential } = require("@alicloud/credentials");

const config = new Config({
    credential: new Credential(),
    regionId: "cn-shanghai",
    protocol: "http",
    accessKeyId: process.env.ACCESS_KEY_ID,
    accessKeySecret: process.env.ACCESS_KEY_SECRET,
  });
  const dysmsapiClient = new Dysmsapi20170525(config);
  let ts = await dysmsapiClient.sendSms({
    phoneNumbers: 111111111,
    signName: "xxx",
    templateCode: "SMS_111111",
    templateParam: `{"code":"${c.code}"}`,
  });

经过测试,能跑。
把头部三个包装下。
@yqz0203 @Ccheng2729111 @JacksonTian @denverdino

from alibabacloud-typescript-sdk.

wenerme avatar wenerme commented on May 20, 2024 3

阿里云的文档和客户端都非常差,不介意可以试试最近封装的一个 client,基础功能有了,接口定义还在开发生成工具

https://github.com/wenerme/wode/tree/main/packages/client#alicloud

from alibabacloud-typescript-sdk.

jpgaus avatar jpgaus commented on May 20, 2024 2

笑死

同感,阿里真是没落了,很简单东西,搞得巨复杂,文档写得一坨ss

from alibabacloud-typescript-sdk.

tolerious avatar tolerious commented on May 20, 2024 1

同感

from alibabacloud-typescript-sdk.

kejianfeng avatar kejianfeng commented on May 20, 2024 1

同感,一个那么简单的东西写的比专利还难懂,牛逼

from alibabacloud-typescript-sdk.

yqz0203 avatar yqz0203 commented on May 20, 2024

试了半天,终于跑起来了,文档确实一坨屎。 @Ccheng2729111

import dingtalk from '@alicloud/dingtalk';

 // @ts-ignore
  let client = new dingtalk.oauth2_1_0.default({
    protocol: 'https',
    regionId: 'central',
  });

  const getAccessTokenRequest = new dingtalk.oauth2_1_0.GetAccessTokenRequest({
    appKey: 'xxx',
    appSecret:
      'xxxx',
  });

  try {
    const res = await client.getAccessToken(getAccessTokenRequest);

    console.log(res.body.accessToken,res.body.expireIn);
  } catch (err) {
    console.log(err);
  }

from alibabacloud-typescript-sdk.

tolerious avatar tolerious commented on May 20, 2024

同感,一个那么简单的东西写的比专利还难懂,牛逼

可能我们的水平都太低了。 😄

from alibabacloud-typescript-sdk.

ezxby avatar ezxby commented on May 20, 2024

能把一个短信包封装这么好,文档写的如此专业化,我相信阿里会引领世界100年不动摇

from alibabacloud-typescript-sdk.

ezxby avatar ezxby commented on May 20, 2024

阿里的确走下坡路了,就如同现在的淘宝,上比不了JD下比不了拼多多

from alibabacloud-typescript-sdk.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.