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 @@