fix: enforce application limits and signature format
This commit is contained in:
@@ -6,6 +6,7 @@ const capabilityLabels = [
|
||||
['uplinkQueryEnabled', '上行查询'],
|
||||
['receiptWebhookEnabled', '回执回调'],
|
||||
['uplinkWebhookEnabled', '上行回调'],
|
||||
['credentialSelfServiceEnabled', '客户端自助密钥'],
|
||||
] as const;
|
||||
|
||||
const deliveryModeLabels: Record<string, string> = {
|
||||
@@ -20,6 +21,7 @@ export function formatHttpApiParams(response: HttpApiConfigResponse, origin: str
|
||||
const baseUrl = `${origin.replace(/\/$/, '')}/api/openapi/v1`;
|
||||
return [
|
||||
`应用名称: ${response.applicationName ?? response.applicationId}`,
|
||||
`AppID: ${response.applicationId}`,
|
||||
`HTTP接口: ${config?.enabled ? '开通' : '关闭'}`,
|
||||
`基础地址: ${baseUrl}`,
|
||||
`接口文档: ${origin.replace(/\/$/, '')}/api/client-docs`,
|
||||
|
||||
@@ -5,6 +5,12 @@ export function formatSmsSignature(name?: string | null) {
|
||||
return innerName ? `【${innerName}】` : '';
|
||||
}
|
||||
|
||||
export function isCompleteSmsSignature(name?: string | null) {
|
||||
const value = (name ?? '').trim();
|
||||
const match = value.match(/^【([^【】]+)】$/);
|
||||
return Boolean(match && match[1] === match[1].trim());
|
||||
}
|
||||
|
||||
export function replaceLeadingSmsSignature(content: string, signatureName?: string | null) {
|
||||
const body = content.replace(LEADING_SMS_SIGNATURE, '');
|
||||
return `${formatSmsSignature(signatureName)}${body}`;
|
||||
|
||||
Reference in New Issue
Block a user