const OSS = require('ali-oss'); let client = new OSS({ region: 'oss-cn-hangzhou', // 上传后的域名 accessKeyId: 'LTAI5tFAiAq9SjM9vaucMuYD', // 后台的临时签名ID accessKeySecret: 'RHDmRIOaYlEXe9t1ro7ls8Ejcnhigv', // 后台的临时签名密钥 stsToken: '', bucket: 'guojunjie', // OSS仓库名 }); // 上传方法 const ossUpload = (file) => { // let curTime = new Date(); // let year = curTime.getFullYear(); // let month = curTime.getMonth() + 1; // let day = curTime.getDate(); let dir = 'pixelAi/'; client.multipartUpload(dir+'测试', file).then(ress=>{ console.log(ress); }) } export { ossUpload }