Преглед изворни кода

fix: 更新接口添加参数检测防止报错

johnsen пре 4 месеци
родитељ
комит
f7f8397666
1 измењених фајлова са 7 додато и 1 уклоњено
  1. 7 1
      src/business/platform/form/utils/custom/joinCURD.js

+ 7 - 1
src/business/platform/form/utils/custom/joinCURD.js

@@ -54,7 +54,13 @@ const post = (
 ) => {
   const requestUrl = `${BASE_URL}${normal[type]}`
   const isQueryType = type === 'query'
-
+  if (type === 'update') {
+    const params = Object.isObject(data) ? data : JSON.parse(data)
+    if (!params.updList || params.updList.length < 1) {
+      console.log('update更新请求参数为空中断请求!')
+      return
+    }
+  }
   // 查询类型默认无 loading 动画,非查询类型要关闭 loading 动画需传参 loading:true
   const isLoading = ['sql', 'query'].includes(type) ? loading : !loading