瀏覽代碼

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

johnsen 9 月之前
父節點
當前提交
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