From 8d9aa4718d1ebfea078f398a0bb6a01b4fa47bb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B2=A1=E5=A4=8D=E4=B9=A0?= <2353956224@qq.com>
Date: Mon, 20 Apr 2026 14:52:22 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=99=BB=E5=BD=95=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 24 +++++++++++++++++++++++-
src/components/HostListDialog.vue | 9 ++++++++-
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index a61848c..c807af8 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -8,7 +8,7 @@
-
+
@@ -47,6 +47,7 @@ import UpdateNotification from './components/UpdateNotification.vue'
import NoticeBar from './components/NoticeBar.vue'
import { useNoticeStore } from './stores/noticeStore'
import { ElMessage } from 'element-plus'
+import { getPermissions } from './utils/storage'
// Constants
const USER_KEY = 'user_data'
@@ -104,6 +105,7 @@ onMounted(() => {
const user = JSON.parse(userData)
if (user && user.tokenValue) {
currentPage.value = 'browser'
+ void syncAutotkPermissionLimit()
}
}
} catch { } // eslint-disable-line no-empty
@@ -206,12 +208,32 @@ const handleStorageChange = (e) => {
}
}
+const syncAutotkPermissionLimit = async () => {
+ if (!isElectron()) return
+ try {
+ const permissions = getPermissions()
+ if (permissions?.autotk === 1) return
+ await window.electronAPI.updateAutomationConfig({
+ filters: {
+ maxAnchorCount: 1
+ }
+ })
+ } catch (e) {
+ console.warn('[App] 同步 autotk 权限限制失败:', e)
+ }
+}
+
const clearLoginState = () => {
localStorage.removeItem(USER_KEY)
localStorage.removeItem('user')
localStorage.removeItem('token')
}
+const handleLoginSuccess = async () => {
+ currentPage.value = 'browser'
+ await syncAutotkPermissionLimit()
+}
+
// 处理配置更新事件
const handleConfigUpdate = () => {
console.log('[App] 收到配置更新事件,重新加载配置')
diff --git a/src/components/HostListDialog.vue b/src/components/HostListDialog.vue
index 2eb2c43..ab38215 100644
--- a/src/components/HostListDialog.vue
+++ b/src/components/HostListDialog.vue
@@ -257,6 +257,7 @@