feat(desktop-client): add settings window and switch default API to production

- Open a dedicated settings BrowserWindow with general / login / diagnostics / about tabs
- Persist openAtLogin and keepRunningInBackground via desktop-settings.json; hide main window instead of quitting when background mode is on
- Default API base URL now points to api.shengxintui.com; LoginView and SettingsView share a single constant
- Restore wangyihao session cookies on probe and silent refresh, and accept the legacy http://mp.163.com console origin
- Drop the standalone diagnostics view in favor of the settings tab

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-30 22:00:01 +08:00
parent 40ef60eae2
commit baff51295a
13 changed files with 1110 additions and 226 deletions
+12 -8
View File
@@ -277,19 +277,22 @@ const ZOL_LOGIN_REDIRECT_URLS = [
"https://service.zol.com.cn/user/login",
];
const WANGYI_API_ORIGIN = "https://mp.163.com";
const WANGYI_CONSOLE_ORIGIN = "http://mp.163.com";
const WANGYI_CONSOLE_ORIGIN = "https://mp.163.com";
const WANGYI_LEGACY_CONSOLE_ORIGIN = "http://mp.163.com";
const WANGYI_API_REFERER = `${WANGYI_API_ORIGIN}/subscribe_v4/index.html`;
const WANGYI_INFO_URL = `${WANGYI_API_ORIGIN}/wemedia/info.do`;
const WANGYI_CONSOLE_URL = `${WANGYI_CONSOLE_ORIGIN}/subscribe_v4/index.html`;
const WANGYI_LOGIN_REDIRECT_URLS = [
`${WANGYI_API_ORIGIN}/login.html`,
`${WANGYI_CONSOLE_ORIGIN}/login.html`,
`${WANGYI_LEGACY_CONSOLE_ORIGIN}/login.html`,
"https://reg.163.com/",
"https://dl.reg.163.com/",
];
const WANGYI_COOKIE_URLS = [
WANGYI_API_ORIGIN,
WANGYI_CONSOLE_ORIGIN,
WANGYI_LEGACY_CONSOLE_ORIGIN,
"https://reg.163.com/",
"https://dl.reg.163.com/",
];
@@ -2092,6 +2095,10 @@ export async function probePublishAccountSession(
};
}
if (account.platform === "wangyihao") {
await restoreWangyihaoSessionCookies(account.id, handle.session);
}
const definition = platformBindingDefinitions[account.platform];
if (!definition) {
return {
@@ -2460,6 +2467,10 @@ export async function silentRefreshPublishAccountSession(
return false;
}
if (account.platform === "wangyihao") {
await restoreWangyihaoSessionCookies(account.id, handle.session);
}
const definition = platformBindingDefinitions[account.platform];
if (!definition) {
return false;
@@ -2537,13 +2548,6 @@ export async function inspectPublishAccountLocalSession(
const profile = await resolvePublishAccountProfileFromHandle(account, handle);
if (!profile) {
if (account.platform === "wangyihao") {
return {
availability: "expired",
profile: null,
};
}
const consoleReady = await verifyPublishAccountConsoleAccess(account, handle).catch(() => false);
if (consoleReady) {
return {