|
@@ -307,6 +307,28 @@ const hasValidAccountInfo = computed(() => {
|
|
|
return accountInfo.value.accountName && !defaultNames.includes(accountInfo.value.accountName);
|
|
return accountInfo.value.accountName && !defaultNames.includes(accountInfo.value.accountName);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+// 操作完成则自动关闭(5分钟超时)
|
|
|
|
|
+let autoCloseTimer: ReturnType<typeof setTimeout> | null = null;
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => [loginStatus.value, fetchingAccountInfo.value, hasValidAccountInfo.value],
|
|
|
|
|
+ ([status, fetching, valid]) => {
|
|
|
|
|
+ if (status === 'success' && !fetching && valid && !isAdminMode.value) {
|
|
|
|
|
+ // 操作完成,5分钟后自动关闭浏览器
|
|
|
|
|
+ if (autoCloseTimer) clearTimeout(autoCloseTimer);
|
|
|
|
|
+ autoCloseTimer = setTimeout(() => {
|
|
|
|
|
+ console.log('[BrowserTab] Operation complete, auto-closing browser');
|
|
|
|
|
+ tabsStore.closeTab(props.tab.id);
|
|
|
|
|
+ }, 5 * 60 * 1000);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 操作未完成或失败,取消自动关闭
|
|
|
|
|
+ if (autoCloseTimer) {
|
|
|
|
|
+ clearTimeout(autoCloseTimer);
|
|
|
|
|
+ autoCloseTimer = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+);
|
|
|
|
|
+
|
|
|
const initialUrl = computed(() => {
|
|
const initialUrl = computed(() => {
|
|
|
// 对于百家号管理模式且有预设 Cookie,先跳转到登录页面设置 Cookie
|
|
// 对于百家号管理模式且有预设 Cookie,先跳转到登录页面设置 Cookie
|
|
|
if (platform.value === 'baijiahao' &&
|
|
if (platform.value === 'baijiahao' &&
|