|
@@ -127,7 +127,8 @@ async function downloadUrl(url) {
|
|
|
console.log(url)
|
|
|
if(url?.startsWith("/")) {return url};
|
|
|
let md5 = crypto.createHash('md5');
|
|
|
- let filename = md5.update(url).digest('hex') + path.extname(url)
|
|
|
+ let extname = path.extname(url)?.toLocaleLowerCase();
|
|
|
+ let filename = md5.update(url).digest('hex') + extname;
|
|
|
let filepath = path.join(tempDir,filename)
|
|
|
// console.log(filename,filepath)
|
|
|
try{
|
|
@@ -283,7 +284,8 @@ export async function mergePdfListReduce(pdfList,convertOpts){
|
|
|
if(files?.length==1){ // 单文件直接加载 自动获取后缀
|
|
|
let onefile = files[0]
|
|
|
if(!onefile?.ext){
|
|
|
- onefile = {data:fs.readFileSync(onefile),ext:path.extname(files[0]).slice(1)}
|
|
|
+ let extname = path.extname(files[0]).slice(1)?.toLocaleLowerCase();
|
|
|
+ onefile = {data:fs.readFileSync(onefile),ext:extname}
|
|
|
}
|
|
|
resolve(onefile);
|
|
|
}else{ // 多文件合并
|