update ImageUpload/index.vue

This commit is contained in:
不做码农 2022-05-21 08:08:59 +08:00
parent 4a2c184424
commit 630960bf0c

View File

@ -75,7 +75,7 @@ const uploadList = ref([])
const dialogImageUrl = ref('')
const dialogVisible = ref(false)
const baseUrl = import.meta.env.VITE_APP_BASE_API
const uploadImgUrl = ref(baseUrl + import.meta.env.VITE_APP_UPLOAD_URL ?? '/Common/UploadFile') //
const uploadImgUrl = ref(baseUrl + import.meta.env.VITE_APP_UPLOAD_URL) //
const headers = ref({ Authorization: 'Bearer ' + getToken() })
const fileList = ref([])
const showTip = computed(() => props.isShowTip && (props.fileType || props.fileSize))
@ -89,11 +89,11 @@ watch(
//
fileList.value = list.map((item) => {
if (typeof item === 'string') {
if (item.indexOf(baseUrl) === -1) {
item = { name: baseUrl + item, url: baseUrl + item }
} else {
// if (item.indexOf(baseUrl) === -1) {
// item = { name: baseUrl + item, url: baseUrl + item }
// } else {
item = { name: item, url: item }
}
// }
}
return item
})