|
@@ -1,7 +1,6 @@
|
|
|
import { getToken, getTokenFromApi } from './auth'
|
|
|
import { saveMediaInfo, saveMediaRecord, getLatestRecord, removeInfoAndRecord, getJoinList } from '@/api/work'
|
|
|
import { globalConfig } from '@/config'
|
|
|
-import upload from '@/utils/upload.uts'
|
|
|
|
|
|
|
|
|
// 类型定义保持不变
|
|
@@ -141,7 +140,7 @@ export const downloadDataFromAPI = async (productCode : string, callback ?: () =
|
|
|
// 使用Promise处理HTTP请求,避免嵌套Promise
|
|
|
return new Promise<boolean>((resolve) => {
|
|
|
uni.request({
|
|
|
- url: `${globalConfig.apiUrl}/loadQmImagetask?prodcode=${productCode}`,
|
|
|
+ url: `${globalConfig.host}${globalConfig.downloadURL}${productCode}`,
|
|
|
method: 'GET',
|
|
|
header: {
|
|
|
'token': apiToken
|
|
@@ -219,7 +218,7 @@ export const downloadDataFromAPI = async (productCode : string, callback ?: () =
|
|
|
await new Promise<void>((resolve, reject) => {
|
|
|
// 使用uni.downloadFile下载图片
|
|
|
uni.downloadFile({
|
|
|
- url: `http://192.168.43.62:8080/api/images/getImage?fileId=${example._id}`,
|
|
|
+ url: `${globalConfig.getImgURL}${example._id}`,
|
|
|
header: {
|
|
|
'token': apiToken
|
|
|
},
|
|
@@ -350,7 +349,7 @@ export const uploadDataToAPI = async (productCode : string, callback ?: () => vo
|
|
|
console.log(dataList);
|
|
|
if (dataList != null && dataList.length > 0) {
|
|
|
let doneRecordList = dataList.filter(item => item.getString("status") == '3')
|
|
|
- // console.log("uploadFiles", uploadFiles);
|
|
|
+ console.log(doneRecordList);
|
|
|
if (doneRecordList.length === 0) {
|
|
|
uni.showToast({ title: '上传图片数据为空', icon: 'error' });
|
|
|
return;
|
|
@@ -376,7 +375,7 @@ export const uploadDataToAPI = async (productCode : string, callback ?: () => vo
|
|
|
await new Promise<void>((resolve, reject) => {
|
|
|
// 使用uni.uploadFile进行文件上传
|
|
|
uni.uploadFile({
|
|
|
- url: 'http://192.168.43.62:8080/api/images/upload',
|
|
|
+ url: `${globalConfig.uploadURL}`,
|
|
|
filePath: fullFilePath,
|
|
|
name: 'file', // 文件参数名
|
|
|
header: {
|