Cell - COS 组件
@celljs/cloud 的 ObjectStorageService 在 腾讯云 COS 上,使用 cos-nodejs-sdk-v5 SDK。
bash
npm install @celljs/cosyaml
cloud:
region: ap-guangzhou
credentials:
accessKeyId: "${env.TENCENTCLOUD_SECRET_ID}"
accessKeySecret: "${env.TENCENTCLOUD_SECRET_KEY}"ts
@Autowired(ObjectStorageService)
protected readonly storage: ObjectStorageService<any>;
await this.storage.putObject({ bucket: 'my-bucket-1250000000', key: 'a.txt', body: 'hello' });COS 存储桶名包括 APPID。cloud.client 把额外的选项传给 COS 客户端。见 @celljs/cloud 了解接口和凭据来源。