|
@@ -106,40 +106,24 @@ const { TextArea } = Input;
|
106
|
106
|
|
107
|
107
|
const handleSubmit = val => {
|
108
|
108
|
let {...submitValue} = val
|
|
109
|
+
|
109
|
110
|
if(newsId){
|
|
111
|
+ console.log("newsId" + newsId);
|
110
|
112
|
submitValue.newsId = newsId
|
111
|
|
- request({ ...apis.news.cancel, urlData: { id: newsId },}).then((data) => {
|
|
113
|
+ request({ ...apis.news.post, data: { submitValue },}).then((data) => {
|
112
|
114
|
cancelPage();
|
113
|
115
|
}).catch((err) => {
|
114
|
116
|
message.info(err.msg || err.message)
|
115
|
117
|
})
|
116
|
118
|
|
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
|
119
|
}else{
|
128
|
|
- request({ ...apis.news.post, data: { submitValue },}).then((data) => {
|
|
120
|
+ console.log("newsIds" + newsId);
|
|
121
|
+ request({ ...apis.news.cancel, urlData: { id: newsId },}).then((data) => {
|
129
|
122
|
cancelPage();
|
130
|
123
|
}).catch((err) => {
|
131
|
124
|
message.info(err.msg || err.message)
|
132
|
125
|
})
|
133
|
126
|
|
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
|
127
|
}
|
144
|
128
|
}
|
145
|
129
|
|