Commit 164bf2a4 authored by Sixiang_Zzb's avatar Sixiang_Zzb

用户管理批零上传bug修复,适配老版本excel文档

parent 456aff51
...@@ -95,21 +95,22 @@ const Users = (props: any) => { ...@@ -95,21 +95,22 @@ const Users = (props: any) => {
// 上传的模块 // 上传的模块
const propsUpload = { const propsUpload = {
name: 'file', name: 'file',
// action: () => {
// // return 'http://47.74.233.180:8651/tos/excel/upload?userId=' + id;
// // return 'http://192.168.1.28:8651/tos/excel/upload?userId=' + id;
// return '/tos/excel/upload?userId=' + id;
// },
action: '/tos/excel/upload?userId=' + id, action: '/tos/excel/upload?userId=' + id,
beforeUpload: (file: any) => { beforeUpload: (file: any) => {
if (permissionArr.indexOf('4') < 0) { if (permissionArr.indexOf('4') < 0) {
message.error('No permissions'); message.error('No permissions');
return false; return false;
} }
if (file.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') { if (
file.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
file.type !== 'application/vnd.ms-excel'
) {
message.error(`${file.name} file format is incorrect!`); message.error(`${file.name} file format is incorrect!`);
} }
return file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; return (
file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
file.type === 'application/vnd.ms-excel'
);
}, },
onChange(info: any) { onChange(info: any) {
if (info.file.status == 'uploading') { if (info.file.status == 'uploading') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment