aws上传路径变更
continuous-integration/drone/push Build is passing Details

uat_us
DESKTOP-6C3NK6N\WXS 2024-09-18 13:51:03 +08:00
parent 371a3acff2
commit 857abb2c0d
3 changed files with 7 additions and 5 deletions

View File

@ -363,7 +363,6 @@ export default {
return (this.option = this.$d.FeedBackTypeToCRC); return (this.option = this.$d.FeedBackTypeToCRC);
}, },
setTitle(code, name) { setTitle(code, name) {
console.log(code, name);
if (this.hasPermi(["role:pm"]) && this.visitTaskId) { if (this.hasPermi(["role:pm"]) && this.visitTaskId) {
return `${this.$t("feedBack:form:title:pm2")}(${code}/${name})`; return `${this.$t("feedBack:form:title:pm2")}(${code}/${name})`;
} }

View File

@ -46,7 +46,7 @@ export async function exist(s3, bucket, fileInformation, progressFn, changeStatu
if (fileInformation.sharding.length === 0) { if (fileInformation.sharding.length === 0) {
let existBucket = await existInBucket({ s3, bucket, fileInformation: fileInformation }); let existBucket = await existInBucket({ s3, bucket, fileInformation: fileInformation });
if (existBucket === 'true') { if (existBucket === 'true') {
progressFn(0, fileInformation.file, 1); progressFn(1, fileInformation.file, 0);
changeStatus(fileInformation.path, 'success');//直接告诉前端,状态 changeStatus(fileInformation.path, 'success');//直接告诉前端,状态
return; return;
} else if (existBucket === 'same key') { } else if (existBucket === 'same key') {

View File

@ -188,11 +188,14 @@ function uploadAWS(aws, data, progress) {
objectItem[objectItem.length - 1] = new Date().getTime() + '_' + objectItem[objectItem.length - 1] objectItem[objectItem.length - 1] = new Date().getTime() + '_' + objectItem[objectItem.length - 1]
data.path = objectItem.join('/') data.path = objectItem.join('/')
} }
await exist(aws, Vue.prototype.OSSclientConfig.bucket, data, progress, (path, status) => { let bucketName = data.path.split("/")[1] || Vue.prototype.OSSclientConfig.bucket
let curPath = data.path;
data.path = data.path.replace(`/${bucketName}/`, '');
await exist(aws, bucketName, data, progress, (path, status) => {
if (status === 'success') { if (status === 'success') {
resolve({ resolve({
name: Vue.prototype.OSSclientConfig.bucket + "/" + decodeUtf8(path), name: decodeUtf8(curPath),
url: Vue.prototype.OSSclientConfig.viewEndpoint + Vue.prototype.OSSclientConfig.bucket + "/" + decodeUtf8(path) url: Vue.prototype.OSSclientConfig.viewEndpoint + decodeUtf8(curPath)
}) })
} else { } else {
reject() reject()