t-ali-oss
author: the.one
Project setup
npm install t-ali-oss --save-dev;
or
yarn add t-ali-oss --save-dev;
Syntax
flie.raw
Cite
import update from 't-ali-oss';
Employ
/**
*
* axios get oss init data
*
* @params file required
* @params Custom Attribute, Object, default null
* @params oss init options or by interface URL get oss init data the method is GET
*
* @returns fileName
* @returns fileType
* @returns fileUrl
* @returns customOps
*
*/
let { fileUrl, fileName } = await update(file, {
region: data.region,
accessKeyId: data.accessKeyId,
accessKeySecret: data.accessKeySecret,
stsToken: data.stsToken,
bucket: data.bucket
}, null // Custom Attribute);
or
let { fileUrl, fileName } = await update(file, {
region: data.region,
accessKeyId: data.accessKeyId,
accessKeySecret: data.accessKeySecret,
stsToken: data.stsToken,
bucket: data.bucket
});
Customize configuration
See API.