Browse Source

Merge branch 'sagacare' of http://39.106.8.246:3003/sagacloud/sagacloud-manager-control into sagacare

zhaojing 1 year ago
parent
commit
6475f9b4b1
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/pages/Information/index.jsx

+ 5 - 1
src/pages/Information/index.jsx

@@ -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);
       });