Browse Source

修复图片上传问题

Hello小健 1 day ago
parent
commit
fc82d91a24
2 changed files with 7 additions and 3 deletions
  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" //入库