Browse Source

1、修复打包失败

master
bjang03 7 months ago
parent
commit
2057781144
  1. 11
      src/api/upload.ts
  2. 2
      src/components/search/index.vue
  3. 25
      src/pages/deviceReport/addForm.vue

11
src/api/upload.ts

@ -1,11 +0,0 @@
import upload from '@/api/uploadHttp'
// import request from '@/utils/request'
// 上传
export function uploadFile(data) {
return upload({
url: '/infra/file/upload',
method: 'post',
filePath:data.filePath,
name: data.name
})
}

2
src/components/search/index.vue

@ -16,7 +16,7 @@
</u-search>
</view>
<view class="screen-btn" @click="screen" v-if="isShowScreen">
<image src="../../static/icon/screen.png" mode="widthFix"></image>
<image src="../../static/icons/screen.png" mode="widthFix"></image>
<view>筛选</view>
</view>
</view>

25
src/pages/deviceReport/addForm.vue

@ -73,7 +73,6 @@
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as dictApi from "@/api/dict.js"
import * as uploadApi from "@/api/upload.js"
import * as deptApi from "@/api/dept.js"
const { proxy } = getCurrentInstance()
const loading = ref(false)
@ -278,18 +277,18 @@
success: (res) => {
let filePath = res.tempFilePaths[0]
proxy.$modal.loading()
uploadApi.uploadFile({
filePath: filePath,
name: 'file',
formData: {
'user': 'test'
},
}).then(ret => {
proxy.$modal.closeLoading()
imgList.value.push(ret.data)
}).catch((err) => {
proxy.$modal.closeLoading()
});
// uploadApi.uploadFile({
// filePath: filePath,
// name: 'file',
// formData: {
// 'user': 'test'
// },
// }).then(ret => {
// proxy.$modal.closeLoading()
// imgList.value.push(ret.data)
// }).catch((err) => {
// proxy.$modal.closeLoading()
// });
},
});
}

Loading…
Cancel
Save