完善本地文件上传扩展名获取

This commit is contained in:
COOL 2025-10-28 14:18:17 +08:00
parent e2810c149e
commit f90eb9d63b

View File

@ -39,7 +39,7 @@ export class CoolPlugin extends BasePluginHook implements BaseUpload {
async downAndUpload(url: string, fileName?: string) {
const { domain } = this.pluginInfo.config;
// 从url获取扩展名
const extend = path.extname(url);
const extend = path.extname(fileName ? fileName : url);
const download = require('download');
// 数据
const data = url.includes('http')