mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-01-04 07:58:11 +00:00
Compare commits
No commits in common. "f89035e48fe2e59e83e83486aaef5f1dba558986" and "6bd54ef1aa1292bd5c1670a34442e0a5991019c3" have entirely different histories.
f89035e48f
...
6bd54ef1aa
@ -33,7 +33,7 @@ export function useUpload() {
|
|||||||
const ext = extname(file.name);
|
const ext = extname(file.name);
|
||||||
|
|
||||||
// 文件名
|
// 文件名
|
||||||
const name = filename(file.name) + '_' + fileId + '.' + ext;
|
const name = filename(file.name) + '_' + fileId + ext;
|
||||||
|
|
||||||
// Key
|
// Key
|
||||||
let key = isLocal ? name : pathJoin(prefixPath!, name);
|
let key = isLocal ? name : pathJoin(prefixPath!, name);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { last } from 'lodash-es';
|
import { last } from 'lodash-es';
|
||||||
import { extname } from '/@/cool/utils';
|
import { filename, extname } from '/@/cool/utils';
|
||||||
import { module } from '/@/cool';
|
import { module } from '/@/cool';
|
||||||
|
|
||||||
// 模块参数
|
// 模块参数
|
||||||
@ -25,11 +25,7 @@ export function fileRule(path?: string) {
|
|||||||
return e.exts.find(a => a == extname(path || '').toLocaleLowerCase());
|
return e.exts.find(a => a == extname(path || '').toLocaleLowerCase());
|
||||||
});
|
});
|
||||||
|
|
||||||
if (path?.includes('data:image/')) {
|
return (d || last(rules))!;
|
||||||
return rules.find(e => e.type == 'image')!;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (d || rules.find(e => e.type == 'file')!)!;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取规则
|
// 获取规则
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user