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:
34
backend/node_modules/express-validator/lib/context-items/sanitization.js
generated
vendored
Normal file
34
backend/node_modules/express-validator/lib/context-items/sanitization.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Sanitization = void 0;
|
||||
const utils_1 = require("../utils");
|
||||
class Sanitization {
|
||||
constructor(sanitizer, custom, options = [],
|
||||
// For testing only.
|
||||
// Deliberately not calling it `toString` in order to not override `Object.prototype.toString`.
|
||||
stringify = utils_1.toString) {
|
||||
this.sanitizer = sanitizer;
|
||||
this.custom = custom;
|
||||
this.options = options;
|
||||
this.stringify = stringify;
|
||||
}
|
||||
async run(context, value, meta) {
|
||||
const { path, location } = meta;
|
||||
const runCustomSanitizer = async () => {
|
||||
const sanitizerValue = this.sanitizer(value, meta);
|
||||
return Promise.resolve(sanitizerValue);
|
||||
};
|
||||
if (this.custom) {
|
||||
const newValue = await runCustomSanitizer();
|
||||
context.setData(path, newValue, location);
|
||||
return;
|
||||
}
|
||||
const values = Array.isArray(value) ? value : [value];
|
||||
const newValues = values.map(value => {
|
||||
return this.sanitizer(this.stringify(value), ...this.options);
|
||||
});
|
||||
// We get only the first value of the array if the original value was wrapped.
|
||||
context.setData(path, values !== value ? newValues[0] : newValues, location);
|
||||
}
|
||||
}
|
||||
exports.Sanitization = Sanitization;
|
||||
Reference in New Issue
Block a user