|
@@ -1,5 +1,6 @@
|
|
import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
|
import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
|
import styles from './index.less';
|
|
import styles from './index.less';
|
|
|
|
+import { useModel } from 'umi';
|
|
import { Input, message } from 'antd';
|
|
import { Input, message } from 'antd';
|
|
import {
|
|
import {
|
|
companyInfo,
|
|
companyInfo,
|
|
@@ -20,7 +21,10 @@ export default () => {
|
|
const handleFileSelected = useCallback(
|
|
const handleFileSelected = useCallback(
|
|
(e) => {
|
|
(e) => {
|
|
const file = e.target.files[0];
|
|
const file = e.target.files[0];
|
|
- let fileName = file.name;
|
|
|
|
|
|
+ if (file.size > 1024 * 1024 * 10) {
|
|
|
|
+ message.error('文件大小不能超过 10MB');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
importUsers(file).then((res) => {
|
|
importUsers(file).then((res) => {
|
|
send('logUrl', res.data.fileKey);
|
|
send('logUrl', res.data.fileKey);
|
|
});
|
|
});
|