修复图片上传bug
This commit is contained in:
parent
4e1307b00e
commit
819ab8427a
|
|
@ -1,4 +1,4 @@
|
|||
NODE_ENV = 'development'
|
||||
|
||||
# Base API
|
||||
# 请求域名
|
||||
VITE_APP_BASE_URL='https://likeadmin-java.yixiangonline.com'
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
NODE_ENV = 'production'
|
||||
# Base API
|
||||
|
||||
# 请求域名
|
||||
VITE_APP_BASE_URL=''
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
:close-on-click-modal="false"
|
||||
width="500px"
|
||||
:modal="false"
|
||||
:before-close="handleClose"
|
||||
@close="handleClose"
|
||||
>
|
||||
<div class="file-list p-4">
|
||||
<template v-for="(item, index) in fileList" :key="index">
|
||||
|
|
@ -44,6 +44,7 @@ import useUserStore from '@/stores/modules/user'
|
|||
import config from '@/config'
|
||||
import feedback from '@/utils/feedback'
|
||||
import type { ElUpload } from 'element-plus'
|
||||
import { RequestCodeEnum } from '@/enums/requestEnums'
|
||||
export default defineComponent({
|
||||
components: {},
|
||||
props: {
|
||||
|
|
@ -87,7 +88,7 @@ export default defineComponent({
|
|||
|
||||
const handleProgress = (event: any, file: any, fileLists: any[]) => {
|
||||
visible.value = true
|
||||
fileList.value = fileLists
|
||||
fileList.value = toRaw(fileLists)
|
||||
}
|
||||
|
||||
const handleSuccess = (response: any, file: any, fileLists: any[]) => {
|
||||
|
|
@ -95,9 +96,9 @@ export default defineComponent({
|
|||
if (allSuccess) {
|
||||
uploadRefs.value?.clearFiles()
|
||||
visible.value = false
|
||||
emit('change')
|
||||
}
|
||||
emit('change')
|
||||
if (response.code == 0 && response.show && response.msg) {
|
||||
if (response.code == RequestCodeEnum.FAILED && response.msg) {
|
||||
feedback.msgError(response.msg)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue