From f89035e48fe2e59e83e83486aaef5f1dba558986 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Wed, 7 May 2025 10:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/upload/utils/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/upload/utils/index.ts b/src/plugins/upload/utils/index.ts index d1b2f31..9e2b8a7 100644 --- a/src/plugins/upload/utils/index.ts +++ b/src/plugins/upload/utils/index.ts @@ -1,5 +1,5 @@ import { last } from 'lodash-es'; -import { filename, extname } from '/@/cool/utils'; +import { extname } from '/@/cool/utils'; import { module } from '/@/cool'; // 模块参数 @@ -25,7 +25,11 @@ export function fileRule(path?: string) { return e.exts.find(a => a == extname(path || '').toLocaleLowerCase()); }); - return (d || last(rules))!; + if (path?.includes('data:image/')) { + return rules.find(e => e.type == 'image')!; + } + + return (d || rules.find(e => e.type == 'file')!)!; } // 获取规则