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