修改图片上传替换地址问题
This commit is contained in:
@ -90,11 +90,12 @@ export default {
|
||||
// 然后将数组转为对象数组
|
||||
this.fileList = list.map(item => {
|
||||
if (typeof item === "string") {
|
||||
if (item.indexOf(this.baseUrl) === -1) {
|
||||
item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
||||
} else {
|
||||
item = { name: item, url: item };
|
||||
}
|
||||
item = { name: item, url: item };
|
||||
// if (item.indexOf(this.baseUrl) === -1) {
|
||||
// item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
||||
// } else {
|
||||
// item = { name: item, url: item };
|
||||
// }
|
||||
}
|
||||
return item;
|
||||
});
|
||||
@ -187,7 +188,7 @@ export default {
|
||||
let strs = "";
|
||||
separator = separator || ",";
|
||||
for (let i in list) {
|
||||
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
||||
strs += list[i].url.replace(this.baseUrl, this.baseUrl) + separator;
|
||||
}
|
||||
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user