|
@@ -1,9 +1,10 @@
|
|
|
<!-- eslint-disable vue/no-mutating-props -->
|
|
|
<script setup lang="ts">
|
|
|
import type { BasicFormItem } from '@/types/form'
|
|
|
-import type { UploadProps } from 'element-plus'
|
|
|
+// import type { UploadProps } from 'element-plus'
|
|
|
import { useUserStore } from '@/stores/user'
|
|
|
import { ACCESS_TOKEN } from '@/utils/constants'
|
|
|
+import config from '@/config/defaultSetting'
|
|
|
|
|
|
interface Props {
|
|
|
modelValue: any
|
|
@@ -39,7 +40,7 @@ const headers = reactive({
|
|
|
})
|
|
|
// 图片上传
|
|
|
// const handleUploadSuccess: UploadProps['onSuccess'] = response => {
|
|
|
-// modelValue.value = import.meta.env.VITE_BASE_PATH + response.data
|
|
|
+// modelValue.value = config.uploadSuccessCb(response)
|
|
|
// }
|
|
|
</script>
|
|
|
|
|
@@ -71,7 +72,7 @@ const headers = reactive({
|
|
|
<el-upload
|
|
|
v-else-if="item.type === 'upload'"
|
|
|
v-model:file-list="modelValue"
|
|
|
- :action="baseApi + '/file/upload'"
|
|
|
+ :action="baseApi + config.uploadApi"
|
|
|
:headers="headers"
|
|
|
v-bind="item.props"
|
|
|
v-on="item.events || {}"
|