feat: 接入hotmail api对接与跨域规则

This commit is contained in:
Hero
2026-04-14 19:52:10 +08:00
parent 72a7cb52d4
commit 34ee5a3263
10 changed files with 582 additions and 140 deletions
+9
View File
@@ -7,6 +7,8 @@
root.HotmailUtils = factory();
})(typeof self !== 'undefined' ? self : globalThis, function createHotmailUtils() {
const HOTMAIL_MAIL_API_URL = 'https://apple.882263.xyz/api/mail-new';
const HOTMAIL_SERVICE_MODE_REMOTE = 'remote';
const HOTMAIL_SERVICE_MODE_LOCAL = 'local';
function normalizeText(value) {
return String(value || '')
@@ -25,6 +27,12 @@
return Number.isFinite(timestamp) ? timestamp : 0;
}
function normalizeHotmailServiceMode(rawValue = '') {
return String(rawValue || '').trim().toLowerCase() === HOTMAIL_SERVICE_MODE_REMOTE
? HOTMAIL_SERVICE_MODE_REMOTE
: HOTMAIL_SERVICE_MODE_LOCAL;
}
function extractVerificationCode(text) {
const source = String(text || '');
const matchCn = source.match(/(?:代码为|验证码[^0-9]*?)[\s:]*(\d{6})/i);
@@ -368,6 +376,7 @@
getHotmailVerificationPollConfig,
getHotmailVerificationRequestTimestamp,
isAuthorizedHotmailAccount,
normalizeHotmailServiceMode,
normalizeHotmailMailApiMessages,
normalizeTimestamp,
parseHotmailImportText,