Commit 7e04cacf authored by chenqikuai's avatar chenqikuai

2

parent bcbfe09f
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { UploadFile, UploadProps, useFormItem } from "element-plus"; import { ElMessage, UploadFile, UploadProps, useFormItem } from "element-plus";
import type { UploadInstance } from "element-plus"; import type { UploadInstance } from "element-plus";
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import Icon from "@/components/Icon/index.vue"; import Icon from "@/components/Icon/index.vue";
...@@ -98,6 +98,11 @@ const handleChange = async (e: Event) => { ...@@ -98,6 +98,11 @@ const handleChange = async (e: Event) => {
if (!file) return; if (!file) return;
file_ = file!; file_ = file!;
loading.value = true; loading.value = true;
if (file.size >= 60 * 1024 * 1024) {
ElMessage.error("文件大小超过60M");
loading.value = false;
return;
}
const res = await copyrightUploadFile(file!); const res = await copyrightUploadFile(file!);
fileName = file?.name!; fileName = file?.name!;
name.value = file?.name!; name.value = file?.name!;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment