优化更新

This commit is contained in:
2026-09-13 17:33:13 +08:00
parent 8be23a62a3
commit 7f758cc6e9
97 changed files with 2333 additions and 3595 deletions
@@ -129,18 +129,19 @@ Service 层的 `get_file_url()` 会自动为文件字段补此前缀。
```vue
<template>
<el-upload
<a-upload
:action="uploadUrl"
:headers="headers"
:on-success="handleSuccess"
@change="handleChange"
:before-upload="beforeUpload"
>
<el-button type="primary">上传文件</el-button>
</el-upload>
<a-button type="primary">上传文件</a-button>
</a-upload>
</template>
<script setup>
import { ref } from 'vue';
import { message } from 'ant-design-vue';
import { useUserStore } from '@/store/modules/user';
const uploadUrl = '/api/upload/uploadFile';
@@ -152,7 +153,7 @@ const headers = {
function beforeUpload(file) {
const isLt10M = file.size / 1024 / 1024 < 10;
if (!isLt10M) {
ElMessage.error('文件大小不能超过 10MB');
message.error('文件大小不能超过 10MB');
}
return isLt10M;
}