feat: detect admin mode and warn about auto-start unavailability

This commit is contained in:
wonfen
2025-03-31 03:22:24 +08:00
parent b092f74c88
commit 52a15bb281
8 changed files with 103 additions and 17 deletions

View File

@@ -346,3 +346,12 @@ export const entry_lightweight_mode = async () => {
export const exit_lightweight_mode = async () => {
return invoke<void>("exit_lightweight_mode");
};
export const isAdmin = async () => {
try {
return await invoke<boolean>("is_admin");
} catch (error) {
console.error("检查管理员权限失败:", error);
return false;
}
};