|
@@ -3,6 +3,7 @@
|
|
|
import type { BasicFormItem } from '@/types/form'
|
|
import type { BasicFormItem } from '@/types/form'
|
|
|
import type { UploadProps } from 'element-plus'
|
|
import type { UploadProps } from 'element-plus'
|
|
|
import { useUserStore } from '@/stores/user'
|
|
import { useUserStore } from '@/stores/user'
|
|
|
|
|
+import { ACCESS_TOKEN } from '@/utils/constants'
|
|
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
|
modelValue: any
|
|
modelValue: any
|
|
@@ -26,9 +27,15 @@ const placeholder = (item: BasicFormItem) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+if (props.item.request) {
|
|
|
|
|
+ props.item.request().then((res: any) => {
|
|
|
|
|
+ props.item.options = res
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const user = useUserStore()
|
|
const user = useUserStore()
|
|
|
const headers = reactive({
|
|
const headers = reactive({
|
|
|
- access_token: user.token
|
|
|
|
|
|
|
+ [ACCESS_TOKEN]: user.token
|
|
|
})
|
|
})
|
|
|
// 图片上传
|
|
// 图片上传
|
|
|
const handleUploadSuccess: UploadProps['onSuccess'] = response => {
|
|
const handleUploadSuccess: UploadProps['onSuccess'] = response => {
|