Explorar el Código

修改上传文章接口

aaa hace 3 años
padre
commit
53df7a6328
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      src/views/articleManagement/articleCreate.vue

+ 4 - 3
src/views/articleManagement/articleCreate.vue

@@ -222,7 +222,7 @@ export default {
     // 提交表单
     handleSubmit(e) {
       e.preventDefault();
-
+        
       this.form.setFieldsValue({
         articleParentClass: this.articleParentClass.name
       });
@@ -245,7 +245,8 @@ export default {
             cancelText: "取消",
             onOk() {
               that.loading = true;
-              let params = {
+              let params = { categoryid: that.articleChildClass.id };
+              let bodyParams = {
                 name: values.name,
                 description: values.description,
                 type: "ARTICLE",
@@ -255,7 +256,7 @@ export default {
                 links: []
               };
               that.$_http
-                .post(that.$_API.INTERFACE_POST_ADMIN_MATERIALS, params)
+                .post(that.$_API.INTERFACE_POST_ADMIN_MATERIALS, bodyParams, { params })
                 .then(res => {
                   that.$message.success("新建文章成功");
                   console.log("---上传文章----" + JSON.stringify(res));