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:
2026-01-22 19:39:53 +08:00
commit 4350113979
7649 changed files with 897277 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
/**
* Algorithmic validation functions
* May be used as is or implemented in the workflow of other validators.
*/
/*
* ISO 7064 validation function
* Called with a string of numbers (incl. check digit)
* to validate according to ISO 7064 (MOD 11, 10).
*/
export function iso7064Check(str) {
var checkvalue = 10;
for (var i = 0; i < str.length - 1; i++) {
checkvalue = (parseInt(str[i], 10) + checkvalue) % 10 === 0 ? 10 * 2 % 11 : (parseInt(str[i], 10) + checkvalue) % 10 * 2 % 11;
}
checkvalue = checkvalue === 1 ? 0 : 11 - checkvalue;
return checkvalue === parseInt(str[10], 10);
}
/*
* Luhn (mod 10) validation function
* Called with a string of numbers (incl. check digit)
* to validate according to the Luhn algorithm.
*/
export function luhnCheck(str) {
var checksum = 0;
var second = false;
for (var i = str.length - 1; i >= 0; i--) {
if (second) {
var product = parseInt(str[i], 10) * 2;
if (product > 9) {
// sum digits of product and add to checksum
checksum += product.toString().split('').map(function (a) {
return parseInt(a, 10);
}).reduce(function (a, b) {
return a + b;
}, 0);
} else {
checksum += product;
}
} else {
checksum += parseInt(str[i], 10);
}
second = !second;
}
return checksum % 10 === 0;
}
/*
* Reverse TIN multiplication and summation helper function
* Called with an array of single-digit integers and a base multiplier
* to calculate the sum of the digits multiplied in reverse.
* Normally used in variations of MOD 11 algorithmic checks.
*/
export function reverseMultiplyAndSum(digits, base) {
var total = 0;
for (var i = 0; i < digits.length; i++) {
total += digits[i] * (base - i);
}
return total;
}
/*
* Verhoeff validation helper function
* Called with a string of numbers
* to validate according to the Verhoeff algorithm.
*/
export function verhoeffCheck(str) {
var d_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]];
var p_table = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 5, 7, 6, 2, 8, 3, 0, 9, 4], [5, 8, 0, 3, 7, 9, 6, 1, 4, 2], [8, 9, 1, 6, 0, 4, 3, 5, 2, 7], [9, 4, 5, 3, 1, 2, 6, 8, 7, 0], [4, 2, 8, 6, 5, 7, 3, 9, 0, 1], [2, 7, 9, 3, 8, 0, 6, 4, 1, 5], [7, 0, 4, 6, 9, 1, 3, 2, 5, 8]];
// Copy (to prevent replacement) and reverse
var str_copy = str.split('').reverse().join('');
var checksum = 0;
for (var i = 0; i < str_copy.length; i++) {
checksum = d_table[checksum][p_table[i % 8][parseInt(str_copy[i], 10)]];
}
return checksum === 0;
}

View File

@@ -0,0 +1,4 @@
export default function assertString(input) {
if (input === undefined || input === null) throw new TypeError("Expected a string but received a ".concat(input));
if (input.constructor.name !== 'String') throw new TypeError("Expected a string but received a ".concat(input.constructor.name));
}

View File

@@ -0,0 +1,12 @@
function isRegExp(obj) {
return Object.prototype.toString.call(obj) === '[object RegExp]';
}
export default function checkHost(host, matches) {
for (var i = 0; i < matches.length; i++) {
var match = matches[i];
if (host === match || isRegExp(match) && match.test(host)) {
return true;
}
}
return false;
}

View File

@@ -0,0 +1,6 @@
var includes = function includes(arr, val) {
return arr.some(function (arrVal) {
return val === arrVal;
});
};
export default includes;

View File

@@ -0,0 +1,4 @@
var includes = function includes(str, val) {
return str.indexOf(val) !== -1;
};
export default includes;

10
backend/node_modules/validator/es/lib/util/merge.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
export default function merge() {
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var defaults = arguments.length > 1 ? arguments[1] : undefined;
for (var key in defaults) {
if (typeof obj[key] === 'undefined') {
obj[key] = defaults[key];
}
}
return obj;
}

View File

@@ -0,0 +1,12 @@
/**
* Build RegExp object from an array
* of multiple/multi-line regexp parts
*
* @param {string[]} parts
* @param {string} flags
* @return {object} - RegExp object
*/
export default function multilineRegexp(parts, flags) {
var regexpAsStringLiteral = parts.join('');
return new RegExp(regexpAsStringLiteral, flags);
}

View File

@@ -0,0 +1,3 @@
export default function isNullOrUndefined(value) {
return value === null || value === undefined;
}

13
backend/node_modules/validator/es/lib/util/toString.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
export default function toString(input) {
if (_typeof(input) === 'object' && input !== null) {
if (typeof input.toString === 'function') {
input = input.toString();
} else {
input = '[object Object]';
}
} else if (input === null || typeof input === 'undefined' || isNaN(input) && !input.length) {
input = '';
}
return String(input);
}

10
backend/node_modules/validator/es/lib/util/typeOf.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
/**
* Better way to handle type checking
* null, {}, array and date are objects, which confuses
*/
export default function typeOf(input) {
var rawObject = Object.prototype.toString.call(input).toLowerCase();
var typeOfRegex = /\[object (.*)]/g;
var type = typeOfRegex.exec(rawObject)[1];
return type;
}