fix: PNG cover 404 via nginx + clear upload residual after submit
- Fix UAT nginx static cache rule intercepting /api/files/*.png requests, use negative lookahead to exclude /api/ paths (same as Dev config) - Clear el-upload file list after successful game creation to prevent residual file path showing in next upload Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -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<GamePlatform | ''>('')
|
||||
const tagsInput = ref('')
|
||||
const coverFile = ref<File | null>(null)
|
||||
const coverPreview = ref('')
|
||||
const uploadRef = ref<UploadInstance>()
|
||||
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() {
|
||||
<div class="field">
|
||||
<label>封面图</label>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
accept="image/*"
|
||||
|
||||
Reference in New Issue
Block a user