Uploading pictures to Aliyun in vue failed all the time.

as shown in the figure, there seems to be a cross-domain problem locally. Throw exceptions all the time.

import OSS from "ali-oss"

var OSS = require("ali-oss");
const client =new OSS({
    region: self.oss.ossEndPoint,
    accessKeyId: self.oss.ossAccessKeyId,//id
    accessKeySecret: self.oss.ossAccessKeySecret,//id
    bucket: self.bucketImage
})
 return new Promise((resolve,reject)=>{
    client.multipartUpload(name,fileItem.file,{
    progress: function* (percentage, cpt) {
       self.percentage = percentage
        }
    })
    .then((results) => {
        // 
        const url = self.getFileUrl(results.name);
        console.log(url);
        resolve(url); 
    })
    .catch((err) => {
        console.log(err);
    }) 
})

clipboard.png

Jul.13,2022

OSS your bucket, match the cross-domain settings.


has the author solved it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c06f-2baea.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c06f-2baea.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?