fix: 修复配额说明重复和undefined问题
- 在editStorageForm中初始化oss_storage_quota_value和oss_quota_unit - 删除重复的旧配额说明块,保留新的当前配额设置显示 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
24
backend/node_modules/@smithy/hash-stream-node/dist-es/fileStreamHasher.js
generated
vendored
Normal file
24
backend/node_modules/@smithy/hash-stream-node/dist-es/fileStreamHasher.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { createReadStream } from "fs";
|
||||
import { HashCalculator } from "./HashCalculator";
|
||||
export const fileStreamHasher = (hashCtor, fileStream) => new Promise((resolve, reject) => {
|
||||
if (!isReadStream(fileStream)) {
|
||||
reject(new Error("Unable to calculate hash for non-file streams."));
|
||||
return;
|
||||
}
|
||||
const fileStreamTee = createReadStream(fileStream.path, {
|
||||
start: fileStream.start,
|
||||
end: fileStream.end,
|
||||
});
|
||||
const hash = new hashCtor();
|
||||
const hashCalculator = new HashCalculator(hash);
|
||||
fileStreamTee.pipe(hashCalculator);
|
||||
fileStreamTee.on("error", (err) => {
|
||||
hashCalculator.end();
|
||||
reject(err);
|
||||
});
|
||||
hashCalculator.on("error", reject);
|
||||
hashCalculator.on("finish", function () {
|
||||
hash.digest().then(resolve).catch(reject);
|
||||
});
|
||||
});
|
||||
const isReadStream = (stream) => typeof stream.path === "string";
|
||||
Reference in New Issue
Block a user