This commit is contained in:
2025-12-03 18:07:42 +08:00
parent 744b0e088b
commit 502fef024f
2 changed files with 3 additions and 4 deletions

View File

@@ -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('文件上传'), chalk.yellow(`hash: ${res.data.hash}`)]);
newInfos.push(['上传成功', item.key, chalk.green(item.url), chalk.green('文件上传')]);
} else if (res.data?.isNewMeta) {
newInfos.push(['上传成功', item.key, chalk.green(item.url), chalk.green('元数据更新'), chalk.yellow(`hash: ${res.data.hash}`)]);
newInfos.push(['上传成功', item.key, chalk.green(item.url), chalk.green('元数据更新')]);
} else {
// 文件未更新
logger.debug('上传成功', item.key, chalk.green(item.url), chalk.blue('文件未更新'), chalk.yellow(`hash: ${res.data.hash}`));
logger.debug('上传成功', item.key, chalk.green(item.url), chalk.blue('文件未更新'));
}
}
logger.debug(res);

View File

@@ -87,7 +87,6 @@ export const upload = (opts: UploadOptions): Promise<{ code?: number; message?:
opts.url.searchParams.append('size', fileSize.toString());
}
}
console.log('上传文件到', opts.url.toString());
const headers = form.getHeaders();
return new Promise((resolve) => {
form.submit(getFormParams(opts, headers), (err, res) => {