图片上传hash 有bug,修复
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
import { Config, SyncList, SyncConfigType, SyncConfig } from './type.ts';
|
||||
import { Config, SyncList, SyncConfigType } from './type.ts';
|
||||
import { fileIsExist } from '@/uitls/file.ts';
|
||||
import { getHash } from '@/uitls/hash.ts';
|
||||
import glob from 'fast-glob';
|
||||
|
||||
@@ -56,12 +56,12 @@ const syncUpload = new Command('upload')
|
||||
});
|
||||
if (res.code === 200) {
|
||||
if (res.data?.isNew) {
|
||||
newInfos.push(['上传成功', item.key, chalk.green(item.url), chalk.green('文件上传')]);
|
||||
newInfos.push(['上传成功', item.key, chalk.green(item.url), chalk.green('文件上传'), chalk.yellow(`hash: ${res.data.hash}`)]);
|
||||
} else if (res.data?.isNewMeta) {
|
||||
newInfos.push(['上传成功', item.key, chalk.green(item.url), chalk.green('元数据更新')]);
|
||||
newInfos.push(['上传成功', item.key, chalk.green(item.url), chalk.green('元数据更新'), chalk.yellow(`hash: ${res.data.hash}`)]);
|
||||
} else {
|
||||
// 文件未更新
|
||||
logger.info('上传成功', item.key, chalk.green(item.url), chalk.blue('文件未更新'));
|
||||
logger.debug('上传成功', item.key, chalk.green(item.url), chalk.blue('文件未更新'), chalk.yellow(`hash: ${res.data.hash}`));
|
||||
}
|
||||
}
|
||||
logger.debug(res);
|
||||
|
||||
Reference in New Issue
Block a user