diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 596843f5f..1fe7a6c93 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -326,8 +326,8 @@ module.exports = { comments: false }, compress: { - drop_debugger: false, - drop_console: false + drop_debugger: true, + drop_console: true } } }), diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js index fe060835b..0df9a77e4 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Form , Upload , Input , notification, message } from 'antd'; +import { Form , Upload , Input} from 'antd'; import axios from 'axios'; import { getupload_git_file } from 'educoder'; import Repositoryfile from './Repositoryfile'; @@ -29,17 +29,14 @@ class RepositoryAddFileupload_files extends Component { } handleChange = (info) => { - console.log(info) + if (info.file.status === 'done'||info.file.status === "uploading") { let fileList = [...info.fileList]; if(info.file.response){ if(info.file.response.status===-1) { - notification.open({ - message: '提示', - description: info.file.response.message, - }) + this.props.showNotification(info.file.response.message) return } } @@ -51,6 +48,7 @@ class RepositoryAddFileupload_files extends Component { } return file; }); + this.props.showNotification("上传成功") this.setState({ fileList }); } }; @@ -59,10 +57,7 @@ class RepositoryAddFileupload_files extends Component { let shixunId = this.props.match.params.shixunId; let {message,filspath}=this.state; if(message===""||message===undefined){ - notification.open({ - message: '提示', - description: '删除文件请先填写提交信息', - }); + this.props.showNotification('删除文件请先填写提交信息'); return } @@ -177,10 +172,7 @@ class RepositoryAddFileupload_files extends Component { beforeUpload: (file) => { let {message}=this.state; if(message===""||message===undefined){ - notification.open({ - message: '提示', - description: '上传文件请先填写提交信息', - }); + this.props.showNotification("上传文件请先填写提交信息") return false } },