From 60ad89995ec41b539898aa8028d7402b9ce39354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 15:19:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.prod.js | 4 ++-- .../RepositoryAddFileupload_file.js | 20 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) 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 } },