Преглед на файлове

修复图片上传问题

Hello小健 преди 1 ден
родител
ревизия
fc82d91a24
променени са 2 файла, в които са добавени 7 реда и са изтрити 3 реда
  1. 5 1
      pages/instock/index.vue
  2. 2 2
      utils/api.js

+ 5 - 1
pages/instock/index.vue

@@ -780,10 +780,14 @@ const upLoadFile = (signature, image) => {
 		file: image.file
 	};
 	return new Promise((resolve, reject) => {
+		let name = image.name
+			// #ifdef APP-PLUS
+			name = 'file'
+			// #endif
 		const uploadTask = uni.uploadFile({
 			url: signature.host, // 你的上传接口地址
 			filePath: image.path,
-			name: image.name, // 这里根据后端需要的字段来定义
+			name: name, // 这里根据后端需要的字段来定义
 			formData: fileData,
 			success: (uploadFileRes) => {
 				if (uploadFileRes.statusCode === 204 || uploadFileRes.statusCode === 200) {

+ 2 - 2
utils/api.js

@@ -1,5 +1,5 @@
-// const baseURL = 'https://api.ytdeals.co.uk'
-const baseURL = 'http://dsg.tms.api.aibasil.cn'
+const baseURL = 'https://api.ytdeals.co.uk'
+// const baseURL = 'http://dsg.tms.api.aibasil.cn'
 
 export const warehouseScanURL = baseURL + "/admin/order.sheetOrder/warehouseScan" //面单 仓库扫描
 export const instockScanURL = baseURL + "/admin/order.scanOrder/instock" //入库