|
|
|
@ -274,19 +274,25 @@ class CoursesBanner extends Component {
|
|
|
|
|
// 确定
|
|
|
|
|
ModalAction = () => {
|
|
|
|
|
let {coursedata}=this.state;
|
|
|
|
|
|
|
|
|
|
let that=this;
|
|
|
|
|
var push = this.props.history;
|
|
|
|
|
let id = this.props.match.params.coursesId;
|
|
|
|
|
//删除
|
|
|
|
|
if (this.state.metype === 1) {
|
|
|
|
|
console.log("删除");
|
|
|
|
|
this.modalCancel();
|
|
|
|
|
that.setState({
|
|
|
|
|
antIcon:true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var url = `/courses/${id}.json`
|
|
|
|
|
axios
|
|
|
|
|
.delete(url, {})
|
|
|
|
|
.then(function (response) {
|
|
|
|
|
console.log(response.data.status)
|
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
|
that.setState({
|
|
|
|
|
antIcon:false
|
|
|
|
|
})
|
|
|
|
|
that.modalCancel();
|
|
|
|
|
message.success("删除成功", 1)
|
|
|
|
|
push.push(`/courses`)
|
|
|
|
|
|
|
|
|
|