From 9efbc7ffa8355cf7baea78858e43e937cf983e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 20 Sep 2019 16:06:23 +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 --- .../modules/ecs/subroute/ecStudentList/EcStudentList.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js b/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js index a06440cb4..0684e9858 100644 --- a/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js +++ b/public/react/src/modules/ecs/subroute/ecStudentList/EcStudentList.js @@ -131,15 +131,20 @@ class EcStudentList extends Component { uploadfile=(file)=>{ + console.log("导入的文件"); + console.log(file); this.setState({isSpin:true}) let {majorschoollist}=this.state; let year_id=this.props.match.params.yearId; let Url ='/ec_years/'+year_id+'/students/import.json'; + const config = { + headers: { "Content-Type": "multipart/form-data" } + }; const form = new FormData(); form.append('file', file.file); - form.append('attachment_id', file.file.id); + form.append('attachment_id', file.file.lastModified); axios.post(Url,form - ).then((response) => { + ,config).then((response) => { if(response.data.status===0){ // message.success('已成功导入'+response.data.count+"条数据!"); this.setState({