This commit is contained in:
zmj 2024-05-31 11:45:59 +08:00
parent 625578a4b1
commit ad193495f6

View File

@ -1,6 +1,6 @@
<template>
<el-upload :accept="acceptList" :show-file-list="true" aria-hidden="true" :headers="{ Token: userStore?.token }"
:action="base_url + '/upload/file'" :on-success="handleAvatarSuccess" ref="upload" :limit="100" multiple
:action="base_url + '/upload/file'" :on-success="handleSuccess" ref="upload" :limit="100" multiple
:on-preview="previewFile" :on-remove="removeFile" :before-upload="checkSize">
<template #tip>
<span class="text-primary" style="margin-left:5px;font-size:11px">提示:文件单个大小不能超过1个G</span>
@ -39,7 +39,7 @@ const checkSize = (e) => {
}
const handleAvatarSuccess = (response: any) => {
const handleSuccess = (response: any) => {
props.formData[props.value] ||= []
// @ts-ignore
response.code != 0 ? props.formData[props.value].push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);