11.14上传图片修改

dev
xiaohuo 8 months ago
parent 0ab4b2ee7a
commit 83632d6285
  1. 5
      ALOps_sys_fe/alops-ui/src/components/ImageUpload/index.vue

@ -137,6 +137,7 @@ export default {
this.fileList = list.map(item => { this.fileList = list.map(item => {
if (typeof item === "string") { if (typeof item === "string") {
if (item.indexOf(this.baseUrl) === -1 && !isExternal(item)) { if (item.indexOf(this.baseUrl) === -1 && !isExternal(item)) {
item = { name: this.baseUrl + item, url: this.baseUrl + item } item = { name: this.baseUrl + item, url: this.baseUrl + item }
} else { } else {
item = { name: item, url: item } item = { name: item, url: item }
@ -204,7 +205,7 @@ export default {
console.log("%c 🍍: handleUploadSuccess -> res ", "font-size:16px;background-color:#dca159;color:white;", res) console.log("%c 🍍: handleUploadSuccess -> res ", "font-size:16px;background-color:#dca159;color:white;", res)
if (res.code === 200) { if (res.code === 200) {
// URLbaseUrl // URLbaseUrl
let url = res.url let url = res.fileName
if (url && url.indexOf(this.baseUrl) === -1 && !isExternal(url)) { if (url && url.indexOf(this.baseUrl) === -1 && !isExternal(url)) {
url = this.baseUrl + url url = this.baseUrl + url
} }
@ -245,6 +246,7 @@ export default {
}, },
// //
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.dialogImageUrl = file.url this.dialogImageUrl = file.url
this.dialogVisible = true this.dialogVisible = true
}, },
@ -255,6 +257,7 @@ export default {
for (let i in list) { for (let i in list) {
if (list[i].url) { if (list[i].url) {
strs += list[i].url.replace(this.baseUrl, "") + separator strs += list[i].url.replace(this.baseUrl, "") + separator
} }
} }
return strs != '' ? strs.substr(0, strs.length - 1) : '' return strs != '' ? strs.substr(0, strs.length - 1) : ''

Loading…
Cancel
Save