fix: 补齐 MaDao 直连动态选项

恢复 MaDao 直连模式的服务商、国家、线路下拉,并通过 daemon providers/countries/operators 接口级联加载。保存 madaoOperator 并在 direct acquire 中通过 metadata.operator 下发,routing 模式保留已保存的直连配置。
This commit is contained in:
Isulew
2026-05-29 17:53:28 +08:00
parent 0938f5dfba
commit ed1d62687c
10 changed files with 596 additions and 41 deletions
+10
View File
@@ -1453,6 +1453,7 @@ const PERSISTED_SETTING_DEFAULTS = {
madaoRoutingPlanId: '',
madaoProviderId: '',
madaoCountry: '',
madaoOperator: '',
madaoAutoPickCountry: true,
madaoReusePhone: true,
madaoMinPrice: '',
@@ -2245,6 +2246,13 @@ function normalizeMaDaoPrice(value = '') {
return normalizeHeroSmsMaxPrice(value);
}
function normalizeMaDaoOperator(value = '') {
return String(value || '')
.trim()
.toLowerCase()
.replace(/[^a-z0-9_-]+/g, '');
}
function normalizePhonePreferredActivation(value) {
if (!value || typeof value !== 'object' || Array.isArray(value)) {
return null;
@@ -3595,6 +3603,8 @@ function normalizePersistentSettingValue(key, value) {
return normalizeMaDaoProviderId(value);
case 'madaoCountry':
return normalizeMaDaoCountry(value);
case 'madaoOperator':
return normalizeMaDaoOperator(value);
case 'madaoAutoPickCountry':
case 'madaoReusePhone':
return Boolean(value);