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:
50
backend/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js
generated
vendored
Normal file
50
backend/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
export class EndpointCache {
|
||||
capacity;
|
||||
data = new Map();
|
||||
parameters = [];
|
||||
constructor({ size, params }) {
|
||||
this.capacity = size ?? 50;
|
||||
if (params) {
|
||||
this.parameters = params;
|
||||
}
|
||||
}
|
||||
get(endpointParams, resolver) {
|
||||
const key = this.hash(endpointParams);
|
||||
if (key === false) {
|
||||
return resolver();
|
||||
}
|
||||
if (!this.data.has(key)) {
|
||||
if (this.data.size > this.capacity + 10) {
|
||||
const keys = this.data.keys();
|
||||
let i = 0;
|
||||
while (true) {
|
||||
const { value, done } = keys.next();
|
||||
this.data.delete(value);
|
||||
if (done || ++i > 10) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.data.set(key, resolver());
|
||||
}
|
||||
return this.data.get(key);
|
||||
}
|
||||
size() {
|
||||
return this.data.size;
|
||||
}
|
||||
hash(endpointParams) {
|
||||
let buffer = "";
|
||||
const { parameters } = this;
|
||||
if (parameters.length === 0) {
|
||||
return false;
|
||||
}
|
||||
for (const param of parameters) {
|
||||
const val = String(endpointParams[param] ?? "");
|
||||
if (val.includes("|;")) {
|
||||
return false;
|
||||
}
|
||||
buffer += val + "|;";
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user