From 01d453a6d5a751a78eab5f56ad0f35a0a2ebf281 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期三, 17 一月 2024 16:01:48 +0800 Subject: [PATCH] # --- pages/api/addMat.js | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pages/api/addMat.js b/pages/api/addMat.js index 31055b8..9a82460 100644 --- a/pages/api/addMat.js +++ b/pages/api/addMat.js @@ -1,7 +1,9 @@ -async function addMat() { +let network = uni.getStorageSync('Network') +let baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}` +async function addMat(matnr) { let that = this,item = {}; var ress = await uni.request({ - url: 'http://127.0.0.1:8089/bfwms/mat/auth', + url: `${baseUrl}/mat/auth`, data: {matnr: '3CPPJ.B.GMB.LZ.QBY4-10/15P316LLZ'}, }).then((result)=> { let mat = result.data.data @@ -9,7 +11,8 @@ {key: '鍟嗗搧鐮�',value: mat.matnr}, {key: '鍟嗗搧鍚嶇О',value: mat.maktx}, {key: '瑙勬牸',value: mat.specs}, - {key: '鏁伴噺',value: 100}, + {key: '鎵瑰彿',value: '',type: 'input'}, + {key: '鏁伴噺',value: 0,type: 'number-box'}, ] },(res)=>{ console.log(res); @@ -17,11 +20,6 @@ return item } -function isEmpty(obj) { - return typeof obj == "undefined" || obj == null || obj === ""; -} - module.exports = { addMat: addMat, - isEmpty: isEmpty } \ No newline at end of file -- Gitblit v1.9.1