0.1.5 • Published 2 years ago

midwayjs-cool-tencentcloud v0.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

使用方法

安装 midwayjs-cool-tencentcloud

$ npm i midwayjs-cool-tencentcloud --save

引入

...
import * as tencentcloud from 'midwayjs-cool-tencentcloud';
@Configuration({
  imports: [
    orm,
    cool,
    //腾讯云
    tencentcloud
  ],
})
...

配置

后台管理系统-插件管理-腾讯云插件-配置

调用(controller)

import { Get, Inject, Provide } from '@midwayjs/decorator';
import { CoolController, BaseController } from 'midwayjs-cool-core';
import { Sdk } from 'midwayjs-cool-tencentcloud';

@Provide()
@CoolController('/')
export class WelcomeController extends BaseController {
  // 腾讯云
  @Inject('tencentcloud:sdk')
  tencent: Sdk;

  @Get('/')
  public async welcome() {
    const params = {
      SmsSdkAppid: "****",
      Sign: "****",
      PhoneNumberSet: [`+86158****8350`],
      TemplateID: "****",
      TemplateParamSet: ['1234'],
    }
    await this.tencent.smsClient.SendSms(params)
    return this.ok()
  }
}

同理

    // ...
    // 文字识别 模块
    await this.tencent.ocrClient.IDCardOCR(params) // 身份证识别
    // 人像识别 模块
    await this.tencent.iaiClient.DetectFace(params) // 人像分析
    // ...
0.1.5

2 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.14

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago