feat: 接入hotmail api对接与跨域规则
This commit is contained in:
+10
-5
@@ -177,6 +177,7 @@ const EYE_OPEN_ICON = '<svg width="14" height="14" viewBox="0 0 24 24" fill="non
|
||||
const EYE_CLOSED_ICON = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17.94 17.94A10.94 10.94 0 0 1 12 19C5 19 1 12 1 12a21.77 21.77 0 0 1 5.06-6.94"/><path d="M9.9 4.24A10.94 10.94 0 0 1 12 5c7 0 11 7 11 7a21.86 21.86 0 0 1-2.16 3.19"/><path d="M1 1l22 22"/><path d="M14.12 14.12a3 3 0 1 1-4.24-4.24"/></svg>';
|
||||
const COPY_ICON = '<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';
|
||||
const parseHotmailImportText = window.HotmailUtils?.parseHotmailImportText;
|
||||
const normalizeHotmailServiceModeFromUtils = window.HotmailUtils?.normalizeHotmailServiceMode;
|
||||
const shouldClearHotmailCurrentSelection = window.HotmailUtils?.shouldClearHotmailCurrentSelection;
|
||||
const upsertHotmailAccountInList = window.HotmailUtils?.upsertHotmailAccountInList;
|
||||
const filterHotmailAccountsByUsage = window.HotmailUtils?.filterHotmailAccountsByUsage;
|
||||
@@ -950,7 +951,12 @@ function normalizeLocalCpaStep9Mode(value = '') {
|
||||
}
|
||||
|
||||
function normalizeHotmailServiceMode(value = '') {
|
||||
return HOTMAIL_SERVICE_MODE_LOCAL;
|
||||
if (typeof normalizeHotmailServiceModeFromUtils === 'function') {
|
||||
return normalizeHotmailServiceModeFromUtils(value);
|
||||
}
|
||||
return String(value || '').trim().toLowerCase() === HOTMAIL_SERVICE_MODE_REMOTE
|
||||
? HOTMAIL_SERVICE_MODE_REMOTE
|
||||
: HOTMAIL_SERVICE_MODE_LOCAL;
|
||||
}
|
||||
|
||||
function getSelectedLocalCpaStep9Mode() {
|
||||
@@ -975,10 +981,9 @@ function getSelectedHotmailServiceMode() {
|
||||
function setHotmailServiceMode(mode) {
|
||||
const resolvedMode = normalizeHotmailServiceMode(mode);
|
||||
hotmailServiceModeButtons.forEach((button) => {
|
||||
const isRemoteMode = button.dataset.hotmailServiceMode === HOTMAIL_SERVICE_MODE_REMOTE;
|
||||
const active = button.dataset.hotmailServiceMode === resolvedMode;
|
||||
button.disabled = isRemoteMode;
|
||||
button.setAttribute('aria-disabled', String(isRemoteMode));
|
||||
button.disabled = false;
|
||||
button.setAttribute('aria-disabled', 'false');
|
||||
button.classList.toggle('is-active', active);
|
||||
button.setAttribute('aria-pressed', String(active));
|
||||
});
|
||||
@@ -2457,7 +2462,7 @@ btnToggleHotmailList?.addEventListener('click', () => {
|
||||
btnHotmailUsageGuide?.addEventListener('click', async () => {
|
||||
await openConfirmModal({
|
||||
title: '使用教程',
|
||||
message: '由于第三方服务接口结构不同,所以暂时无法使用,如果您的token可以直连微软,请测试本地功能,详细功能请看项目根目录的readme文件',
|
||||
message: 'API对接模式会直接调用微软邮箱接口取件;本地助手模式仍走本地服务。两种模式继续共用同一套 Hotmail 账号池与导入格式。',
|
||||
confirmLabel: '确定',
|
||||
confirmVariant: 'btn-primary',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user