魏超 5 years ago
parent
commit
6cd43c7956
2 changed files with 7 additions and 6 deletions
  1. 2
    6
      src/pages/news/list/editNewsList.jsx
  2. 5
    0
      src/services/apis.js

+ 2
- 6
src/pages/news/list/editNewsList.jsx View File

108
       let {...submitValue} = val
108
       let {...submitValue} = val
109
       
109
       
110
       if(newsId){
110
       if(newsId){
111
-        console.log("newsId" + newsId);
112
         submitValue.newsId = newsId
111
         submitValue.newsId = newsId
113
-        request({ ...apis.news.post, data: { submitValue },}).then((data) => {
112
+        request({ ...apis.news.put, urlData: {id: newsId}, data: { ...submitValue },}).then((data) => {
114
           cancelPage();
113
           cancelPage();
115
         }).catch((err) => {
114
         }).catch((err) => {
116
           message.info(err.msg || err.message)
115
           message.info(err.msg || err.message)
117
         })
116
         })
118
-
119
       }else{
117
       }else{
120
-        console.log("newsIds" + newsId);
121
-        request({ ...apis.news.cancel, urlData: { id: newsId },}).then((data) => {
118
+        request({ ...apis.news.post, data: { ...submitValue },}).then((data) => {
122
           cancelPage();
119
           cancelPage();
123
         }).catch((err) => {
120
         }).catch((err) => {
124
           message.info(err.msg || err.message)
121
           message.info(err.msg || err.message)
125
         })
122
         })
126
-
127
       }
123
       }
128
     }
124
     }
129
     
125
     

+ 5
- 0
src/services/apis.js View File

147
       url: `${prefix}/taNews`,
147
       url: `${prefix}/taNews`,
148
       action: 'admin.taNews.post',
148
       action: 'admin.taNews.post',
149
     },
149
     },
150
+    put: {
151
+      method: 'PUT',
152
+      url: `${prefix}/taNews/:id`,
153
+      action: 'admin.taNews.id.put',
154
+    }
150
   },
155
   },
151
   newsType: {
156
   newsType: {
152
     list: {
157
     list: {