소스 검색

fix: 修复接口请求方式异常

zhangyuhan 4 년 전
부모
커밋
b4d230689c
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/web/staticres/common-module/keep-tags/keep-tags-template.js

+ 4 - 4
src/web/staticres/common-module/keep-tags/keep-tags-template.js

@@ -248,12 +248,12 @@ Vue.component('keep-component', {
         this.ajaxGetAllTags()
       }
     },
-    ajaxFn: function (url, data, callback) {
+    ajaxFn: function (url, data, callback, type) {
       return $.ajax({
         type: 'post',
         url: this.baseAjaxURL + url,
-        contentType: "application/json;charset=utf-8",
-        data: JSON.stringify(data),
+        contentType: type ? 'application/x-www-form-urlencoded' : "application/json;charset=utf-8",
+        data: type ? data : JSON.stringify(data),
         dataType: "json",
         success: typeof callback === 'function' ? callback.bind(this) : new Function()
       })
@@ -344,7 +344,7 @@ Vue.component('keep-component', {
           this.$toast(r.error_msg)
           this.isAddLoading = false
         }
-      })
+      }, true)
     }
   }
 })