功能新增: - OSS 存储使用情况显示(文件页面) - OSS 当日流量统计(阿里云云监控API) - 分享页面路由修复(/s/xxx 格式支持) Bug修复: - 修复分享页面资源路径(相对路径改绝对路径) - 修复分享码获取逻辑(支持路径格式) - 修复OSS配额undefined显示问题 - 修复登录流程OSS配置检查 - 修复文件数为null时的显示问题 依赖更新: - 添加 @alicloud/cms20190101 云监控SDK - 添加 @alicloud/openapi-client Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
81 lines
2.6 KiB
JavaScript
81 lines
2.6 KiB
JavaScript
"use strict";
|
|
// This file is auto-generated, don't edit it
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
/**
|
|
* This is a array module
|
|
*/
|
|
class Client {
|
|
// 按照起止坐标截取数组
|
|
static split(raw, index, limit) {
|
|
return raw.slice(index, index + limit);
|
|
}
|
|
// 判断数组是否包含指定字符串
|
|
static contains(raw, str) {
|
|
if (null === raw || typeof (raw) === 'undefined') {
|
|
throw new Error('not a valid value for parameter');
|
|
}
|
|
return raw.includes(str);
|
|
}
|
|
// 返回指定字符串在数组中的下标,如果不存在返回 -1
|
|
static index(raw, str) {
|
|
if (null === raw || typeof (raw) === 'undefined') {
|
|
throw new Error('not a valid value for parameter');
|
|
}
|
|
return raw.indexOf(str);
|
|
}
|
|
// 返回数组长度
|
|
static size(raw) {
|
|
if (null === raw || typeof (raw) === 'undefined') {
|
|
throw new Error('not a valid value for parameter');
|
|
}
|
|
return raw.length;
|
|
}
|
|
// 根据下标获取数组中的字符串元素
|
|
static get(raw, index) {
|
|
if (null === raw || typeof (raw) === 'undefined') {
|
|
throw new Error('not a valid value for parameter');
|
|
}
|
|
return raw[index];
|
|
throw new Error('Un-implemented!');
|
|
}
|
|
// 数组合并成字符串,并添加指定的间隔字符串
|
|
static join(raw, sep) {
|
|
if (null === raw || typeof (raw) === 'undefined') {
|
|
throw new Error('not a valid value for parameter');
|
|
}
|
|
return raw.join(sep);
|
|
throw new Error('Un-implemented!');
|
|
}
|
|
// 合并两个字符串数组,并返回
|
|
static concat(raw, sep) {
|
|
if (null === raw || typeof (raw) === 'undefined' || null === sep || typeof (sep) === 'undefined') {
|
|
throw new Error('not a valid value for parameter');
|
|
}
|
|
return raw.concat(sep);
|
|
}
|
|
// 数组排序,升序
|
|
static ascSort(raw) {
|
|
if (null === raw || typeof (raw) === 'undefined') {
|
|
throw new Error('not a valid value for parameter');
|
|
}
|
|
return raw.sort();
|
|
}
|
|
// 数组排序,降序
|
|
static descSort(raw) {
|
|
if (null === raw || typeof (raw) === 'undefined') {
|
|
throw new Error('not a valid value for parameter');
|
|
}
|
|
raw.sort(function (a, b) { return b.localeCompare(a); });
|
|
return raw;
|
|
}
|
|
/**
|
|
* append any array item
|
|
*/
|
|
static append(array, item) {
|
|
if (null !== array && Array.isArray(array)) {
|
|
array.push(item);
|
|
}
|
|
}
|
|
}
|
|
exports.default = Client;
|
|
//# sourceMappingURL=client.js.map
|