Browse Source

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

魏熙美 5 years ago
parent
commit
a644e4c66b
3 changed files with 10 additions and 33 deletions
  1. 3
    23
      src/pages/news/list/editNewsList.jsx
  2. 0
    8
      src/pages/news/type/NewsType.jsx
  3. 7
    2
      src/services/apis.js

+ 3
- 23
src/pages/news/list/editNewsList.jsx View File

@@ -106,40 +106,20 @@ const { TextArea } = Input;
106 106
   
107 107
     const handleSubmit = val => { 
108 108
       let {...submitValue} = val
109
+      
109 110
       if(newsId){
110 111
         submitValue.newsId = newsId
111
-        request({ ...apis.news.cancel, urlData: { id: newsId },}).then((data) => {
112
+        request({ ...apis.news.put, urlData: {id: newsId}, data: { ...submitValue },}).then((data) => {
112 113
           cancelPage();
113 114
         }).catch((err) => {
114 115
           message.info(err.msg || err.message)
115 116
         })
116
-
117
-      
118
-        // request({
119
-        //   url: '/api/admin/taNews/' + newsId,
120
-        //   method: 'PUT',
121
-        //   data: submitValue,
122
-        // }).then((data) => {
123
-        //   cancelPage()
124
-        // }).catch((err) => {
125
-        //   message.info(err.msg || err.message)
126
-        // })
127 117
       }else{
128
-        request({ ...apis.news.post, data: { submitValue },}).then((data) => {
118
+        request({ ...apis.news.post, data: { ...submitValue },}).then((data) => {
129 119
           cancelPage();
130 120
         }).catch((err) => {
131 121
           message.info(err.msg || err.message)
132 122
         })
133
-
134
-        // request({
135
-        //   url: '/api/admin/taNews',
136
-        //   method: 'POST',
137
-        //   data: submitValue,
138
-        // }).then((data) => {
139
-        //   cancelPage()
140
-        // }).catch((err) => {
141
-        //   message.info(err.msg || err.message)
142
-        // })
143 123
       }
144 124
     }
145 125
     

+ 0
- 8
src/pages/news/type/NewsType.jsx View File

@@ -68,14 +68,6 @@ function header(props) {
68 68
           message.info(err.msg || err.message)
69 69
         })
70 70
 
71
-        // request({
72
-        //   url: '/api/admin/taNewsType/' + newsId,
73
-        //   method: 'DELETE',
74
-        //   data: { ...row },
75
-        // }).then((data) => {
76
-        //   message.info('操作成功!')
77
-        //   getList({ pageNum: 1, pageSize: 10 });
78
-        // })
79 71
       }
80 72
     });
81 73
   }

+ 7
- 2
src/services/apis.js View File

@@ -143,10 +143,15 @@ export default {
143 143
         action: 'admin.taNews.id.get',
144 144
     },
145 145
     post: {
146
-      method: 'GET',
146
+      method: 'POST',
147 147
       url: `${prefix}/taNews`,
148
-      action: 'admin.taNews.id.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 156
   newsType: {
152 157
     list: {