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