Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(upload): sizelimit api #1553

Merged
merged 1 commit into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/upload/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ImageCard from './image';
import FlowList from './flow-list';
import xhr from '../_common/js/upload/xhr';
import log from '../_common/js/log';
import { formatFiles, isOverSizeLimit } from '../_common/js/upload/utils';
import { formatFiles, isOverSizeLimit1 } from '../_common/js/upload/utils';
import TButton from '../button';
import TDialog from '../dialog';
import SingleFile from './single-file';
Expand Down Expand Up @@ -516,7 +516,7 @@ export default mixins(getConfigReceiverMixins<Vue, UploadConfig>('upload'), getG

handleSizeLimit(fileSize: number) {
const sizeLimit: SizeLimitObj = typeof this.sizeLimit === 'number' ? { size: this.sizeLimit, unit: 'KB' } : this.sizeLimit;
const rSize = isOverSizeLimit(fileSize, sizeLimit.size, sizeLimit.unit);
const rSize = isOverSizeLimit1(fileSize, sizeLimit.size, sizeLimit.unit);
if (!rSize) {
// 有参数 message 则使用,没有就使用全局 global 配置
this.errorMsg = sizeLimit.message
Expand Down