mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-10 11:52:53 +00:00
Compare commits
2 Commits
6bd54ef1aa
...
f89035e48f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f89035e48f | ||
|
|
74348f96af |
@ -33,7 +33,7 @@ export function useUpload() {
|
||||
const ext = extname(file.name);
|
||||
|
||||
// 文件名
|
||||
const name = filename(file.name) + '_' + fileId + ext;
|
||||
const name = filename(file.name) + '_' + fileId + '.' + ext;
|
||||
|
||||
// Key
|
||||
let key = isLocal ? name : pathJoin(prefixPath!, name);
|
||||
|
||||
@ -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')!)!;
|
||||
}
|
||||
|
||||
// 获取规则
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user