oak-external-sdk/src/service/ctyun/Sms.web.ts

33 lines
1000 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

type SendSmsRequest = {
action: 'SendSms' | string; // 系统规定参数。取值SendSms。
phoneNumber: string; // 接收短信的手机号码。格式国内短信无任何前缀的11位手机号码例如1381111****。多个手机号码使用英文","隔开最多支持一次提交200个手机号码。
templateCode: string;
signName: string;
templateParam?: Record<string, string>;
extendCode?: string;
sessionId?: string;
};
type SendSmsResponse = {
code: 'OK' | string;
message: string;
requestId: string;
};
export class CTYunSmsInstance {
accessKey: string;
securityKey: string;
endpoint: string;
constructor(accessKey: string, securityKey: string, endpoint: string) {
this.accessKey = accessKey;
this.securityKey = securityKey;
this.endpoint = endpoint;
}
async sendSms(params: SendSmsRequest) {
console.log('web走不到这里');
return {} as SendSmsResponse;
}
}