|
|
@@ -48,6 +48,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
+import { normalizeResourceUrl } from '@/utils/resource'
|
|
|
|
|
|
export default {
|
|
|
props: {
|
|
|
@@ -107,11 +108,7 @@ export default {
|
|
|
// 然后将数组转为对象数组
|
|
|
this.fileList = list.map(item => {
|
|
|
if (typeof item === "string") {
|
|
|
- if (item.indexOf(this.baseUrl) === -1) {
|
|
|
- item = { name: item, url: item };
|
|
|
- } else {
|
|
|
- item = { name: item, url: item };
|
|
|
- }
|
|
|
+ item = { name: item, url: normalizeResourceUrl(item) };
|
|
|
}
|
|
|
return item;
|
|
|
});
|
|
|
@@ -173,7 +170,7 @@ export default {
|
|
|
// 上传成功回调
|
|
|
handleUploadSuccess(res, file) {
|
|
|
if (res.code === 200) {
|
|
|
- this.uploadList.push({ name: res.fileName, url: res.fileName });
|
|
|
+ this.uploadList.push({ name: res.fileName, url: normalizeResourceUrl(res.fileName) });
|
|
|
this.uploadedSuccessfully();
|
|
|
} else {
|
|
|
this.number--;
|