巡检记录接口对接
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import baseUrl from '@/api/BaseUrl.js'
|
||||
|
||||
// ======================
|
||||
// Props(可配置)
|
||||
@@ -102,7 +103,6 @@ function choose() {
|
||||
sizeType: props.sizeType,
|
||||
success: async res => {
|
||||
const tempPaths = res.tempFilePaths
|
||||
|
||||
// 如果没传上传接口,只返回临时路径
|
||||
if (!props.uploadUrl) {
|
||||
const newItems = tempPaths.map(path => ({ url: path }))
|
||||
@@ -135,9 +135,13 @@ async function uploadSingle(filePath) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: props.uploadUrl,
|
||||
url: `${baseUrl}${props.uploadUrl}`,
|
||||
filePath: filePath,
|
||||
name: props.fileFieldName,
|
||||
header: {
|
||||
Authorization: 'Bearer ' + (uni.getStorageSync('token') || ''),
|
||||
clientid: 'butler'
|
||||
},
|
||||
// ✅ 新增:携带额外参数
|
||||
formData: props.extraData,
|
||||
success: res => {
|
||||
|
||||
Reference in New Issue
Block a user