fix
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user