diff --git a/frontend/nginx.uat.conf b/frontend/nginx.uat.conf index fb55ea6..7e422b5 100644 --- a/frontend/nginx.uat.conf +++ b/frontend/nginx.uat.conf @@ -60,8 +60,8 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } - # 静态资源缓存 - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + # 静态资源缓存(排除 /api/ 路径,避免拦截 PB 文件请求) + location ~* ^/(?!api/|voice-api/).*\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|webp)$ { expires 1y; add_header Cache-Control "public, immutable"; } diff --git a/frontend/src/components/game/AddGameDialog.vue b/frontend/src/components/game/AddGameDialog.vue index 4b3588c..9347764 100644 --- a/frontend/src/components/game/AddGameDialog.vue +++ b/frontend/src/components/game/AddGameDialog.vue @@ -5,7 +5,7 @@ import type { GamePlatform } from '@/types' import { ElMessage } from 'element-plus' import { getAllPlatforms } from '@/api/games' import { Plus } from '@element-plus/icons-vue' -import type { UploadFile } from 'element-plus' +import type { UploadFile, UploadInstance } from 'element-plus' const props = defineProps<{ modelValue: boolean @@ -27,6 +27,7 @@ const platform = ref('') const tagsInput = ref('') const coverFile = ref(null) const coverPreview = ref('') +const uploadRef = ref() const loading = ref(false) const platforms = getAllPlatforms() @@ -62,6 +63,7 @@ async function handleSubmit() { tagsInput.value = '' coverFile.value = null coverPreview.value = '' + uploadRef.value?.clearFiles() emit('created') visible.value = false } catch (error: any) { @@ -92,6 +94,7 @@ async function handleSubmit() {