This commit is contained in:
姜棚 2022-01-21 14:12:54 +08:00
parent 1cbc78c764
commit b73df8bd44
2 changed files with 13 additions and 4 deletions

View File

@ -794,13 +794,19 @@ export default class acclist extends React.Component{
fileChange(e){
// this.initUpload();
let my_file = e.target.files[0];
let my_file = e.target.files[0];
this.setState({myfile:my_file})
this.setState({upload_visible:true})
if(my_file.name.indexOf(".xls")||my_file.name.indexOf(".xlsx")||my_file.name.indexOf(".csv"))
{
if(my_file.size > 2048000)
{
Notify.error("文件大小不能大于2M")
return;
}
let formdata = new FormData()
formdata.append("file",my_file)
formdata.append("path","white_list_excel")

View File

@ -659,6 +659,12 @@ export default class acclist extends React.Component{
if(my_file.name.indexOf(".xls")||my_file.name.indexOf(".xlsx")||my_file.name.indexOf(".csv"))
{
if(my_file.size > 5120000)
{
Notify.error("文件大小不能大于2M")
return;
}
let formdata = new FormData()
formdata.append("file",my_file)
formdata.append("path","white_list_excel")
@ -666,13 +672,10 @@ export default class acclist extends React.Component{
this.setState({file_loading:true})
uploadImg(formdata).then((res)=>{
handelResponse(res,(req,msg)=>{
let data = {
excel:req.path
}
this.setState({mobile_excel:req.path})
getAccessVerification(data).then((res)=>{
this.setState({file_loading:false})
handelResponse(res,(req,msg)=>{