适配rn
This commit is contained in:
parent
265b481850
commit
c8949de48d
|
|
@ -0,0 +1,24 @@
|
|||
type SendSmsRequest = {
|
||||
PhoneNumbers: string[];
|
||||
TemplateCode: string;
|
||||
SignName: string;
|
||||
TemplateParam?: Record<string, string>;
|
||||
SmsUpExtendCode?: string;
|
||||
OutId?: string;
|
||||
};
|
||||
type SendSmsResponse = {
|
||||
Code: 'OK' | string;
|
||||
Message: string;
|
||||
BizId: string;
|
||||
RequestId: string;
|
||||
};
|
||||
export declare class AliSmsInstance {
|
||||
secretId: string;
|
||||
secretKey: string;
|
||||
region: string;
|
||||
endpoint: string;
|
||||
client: any;
|
||||
constructor(secretId: string, secretKey: string, region: string, endpoint: string);
|
||||
sendSms(params: SendSmsRequest): Promise<SendSmsResponse>;
|
||||
}
|
||||
export {};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
export class AliSmsInstance {
|
||||
secretId;
|
||||
secretKey;
|
||||
region;
|
||||
endpoint;
|
||||
client;
|
||||
constructor(secretId, secretKey, region, endpoint) {
|
||||
this.secretId = secretId;
|
||||
this.secretKey = secretKey;
|
||||
this.region = region;
|
||||
this.endpoint = endpoint;
|
||||
const clientConfig = {
|
||||
credential: {
|
||||
secretId: this.secretId,
|
||||
secretKey: this.secretKey,
|
||||
},
|
||||
region: this.region,
|
||||
profile: {
|
||||
httpProfile: {
|
||||
endpoint: this.endpoint || 'dysmsapi.aliyuncs.com',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
async sendSms(params) {
|
||||
console.log('react-native走不到这里');
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
import { SendSmsRequest, SendSmsResponse } from 'tencentcloud-sdk-nodejs/tencentcloud/services/sms/v20210111/sms_models';
|
||||
export declare class TencentSmsInstance {
|
||||
sendSms(params: SendSmsRequest): Promise<SendSmsResponse>;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
export class TencentSmsInstance {
|
||||
async sendSms(params) {
|
||||
console.log('react-native走不到这里');
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
global.fetch = fetch;
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
type SendSmsRequest = {
|
||||
PhoneNumbers: string[];
|
||||
TemplateCode: string;
|
||||
SignName: string;
|
||||
TemplateParam?: Record<string, string>;
|
||||
SmsUpExtendCode?: string;
|
||||
OutId?: string;
|
||||
};
|
||||
type SendSmsResponse = {
|
||||
Code: 'OK' | string;
|
||||
Message: string;
|
||||
BizId: string;
|
||||
RequestId: string;
|
||||
};
|
||||
export declare class AliSmsInstance {
|
||||
secretId: string;
|
||||
secretKey: string;
|
||||
region: string;
|
||||
endpoint: string;
|
||||
client: any;
|
||||
constructor(secretId: string, secretKey: string, region: string, endpoint: string);
|
||||
sendSms(params: SendSmsRequest): Promise<SendSmsResponse>;
|
||||
}
|
||||
export {};
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AliSmsInstance = void 0;
|
||||
class AliSmsInstance {
|
||||
secretId;
|
||||
secretKey;
|
||||
region;
|
||||
endpoint;
|
||||
client;
|
||||
constructor(secretId, secretKey, region, endpoint) {
|
||||
this.secretId = secretId;
|
||||
this.secretKey = secretKey;
|
||||
this.region = region;
|
||||
this.endpoint = endpoint;
|
||||
const clientConfig = {
|
||||
credential: {
|
||||
secretId: this.secretId,
|
||||
secretKey: this.secretKey,
|
||||
},
|
||||
region: this.region,
|
||||
profile: {
|
||||
httpProfile: {
|
||||
endpoint: this.endpoint || 'dysmsapi.aliyuncs.com',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
async sendSms(params) {
|
||||
console.log('react-native走不到这里');
|
||||
return {};
|
||||
}
|
||||
}
|
||||
exports.AliSmsInstance = AliSmsInstance;
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
import { SendSmsRequest, SendSmsResponse } from 'tencentcloud-sdk-nodejs/tencentcloud/services/sms/v20210111/sms_models';
|
||||
export declare class TencentSmsInstance {
|
||||
sendSms(params: SendSmsRequest): Promise<SendSmsResponse>;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TencentSmsInstance = void 0;
|
||||
class TencentSmsInstance {
|
||||
async sendSms(params) {
|
||||
console.log('react-native走不到这里');
|
||||
return {};
|
||||
}
|
||||
}
|
||||
exports.TencentSmsInstance = TencentSmsInstance;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"use strict";
|
||||
global.fetch = fetch;
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
type SendSmsRequest = {
|
||||
PhoneNumbers: string[];
|
||||
TemplateCode: string;
|
||||
SignName: string;
|
||||
TemplateParam?: Record<string, string>;
|
||||
SmsUpExtendCode?: string;
|
||||
OutId?: string;
|
||||
};
|
||||
|
||||
type SendSmsResponse = {
|
||||
Code: 'OK' | string;
|
||||
Message: string;
|
||||
BizId: string;
|
||||
RequestId: string;
|
||||
};
|
||||
|
||||
export class AliSmsInstance {
|
||||
secretId: string;
|
||||
secretKey: string;
|
||||
region: string;
|
||||
endpoint: string;
|
||||
client: any;
|
||||
|
||||
constructor(
|
||||
secretId: string,
|
||||
secretKey: string,
|
||||
region: string,
|
||||
endpoint: string
|
||||
) {
|
||||
this.secretId = secretId;
|
||||
this.secretKey = secretKey;
|
||||
this.region = region;
|
||||
this.endpoint = endpoint;
|
||||
|
||||
const clientConfig = {
|
||||
credential: {
|
||||
secretId: this.secretId,
|
||||
secretKey: this.secretKey,
|
||||
},
|
||||
region: this.region,
|
||||
profile: {
|
||||
httpProfile: {
|
||||
endpoint: this.endpoint || 'dysmsapi.aliyuncs.com',
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async sendSms(params: SendSmsRequest) {
|
||||
console.log('react-native走不到这里');
|
||||
return {} as SendSmsResponse;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import {
|
||||
SendSmsRequest,
|
||||
SendSmsResponse,
|
||||
} from 'tencentcloud-sdk-nodejs/tencentcloud/services/sms/v20210111/sms_models';
|
||||
|
||||
export class TencentSmsInstance {
|
||||
async sendSms(params: SendSmsRequest) {
|
||||
console.log('react-native走不到这里');
|
||||
return {} as SendSmsResponse;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
global.fetch = fetch;
|
||||
Loading…
Reference in New Issue