Skip to content

Commit 9b3b282

Browse files
committed
v0.3.1: 隐藏 Dock 图标,添加手动检查更新功能
- 设置 macOSPrivateApi 隐藏 Dock 图标 - 在设置页面添加"检查更新"按钮 - 手动检查更新时显示"已是最新版本"提示 - 检查失败时显示错误提示
1 parent 353174c commit 9b3b282

File tree

6 files changed

+38
-6
lines changed

6 files changed

+38
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to AutoCode will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.1] - 2026-03-05
9+
10+
### 🎨 Changed
11+
- **隐藏 Dock 图标**:应用不再在 Dock 中显示,只在菜单栏显示,更符合托盘应用的使用习惯
12+
813
## [0.3.0] - 2026-03-05
914

1015
### ✨ Added

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "autocode"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
description = "AutoCode - Smart 2FA verification code extractor for macOS"
55
authors = ["you"]
66
edition = "2021"
@@ -13,7 +13,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]
1313
tauri-build = { version = "2", features = [] }
1414

1515
[dependencies]
16-
tauri = { version = "2", features = ["tray-icon", "image-png"] }
16+
tauri = { version = "2", features = ["tray-icon", "image-png", "macos-private-api"] }
1717
tauri-plugin-opener = "2"
1818
tauri-plugin-updater = "2"
1919
serde = { version = "1", features = ["derive"] }

src-tauri/tauri.conf.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "AutoCode",
4-
"version": "0.3.0",
4+
"version": "0.3.1",
55
"identifier": "com.autocode.app",
66
"build": {
77
"frontendDist": "../src"
88
},
99
"app": {
1010
"withGlobalTauri": true,
11+
"macOSPrivateApi": true,
1112
"windows": [
1213
{
1314
"label": "main",

src/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ <h2 class="card-title">通用</h2>
211211
<span class="slider"></span>
212212
</label>
213213
</div>
214+
<div class="setting-row">
215+
<div class="setting-info">
216+
<span class="setting-name">检查更新</span>
217+
<span class="setting-desc">检查并安装最新版本</span>
218+
</div>
219+
<button class="perm-btn" id="btn-check-update">检查更新</button>
220+
</div>
214221
</section>
215222

216223
<!-- 识别规则 -->

src/main.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ function initApp() {
5757
});
5858
document.getElementById('btn-recheck').addEventListener('click', checkPermissions);
5959

60+
// 检查更新按钮
61+
document.getElementById('btn-check-update').addEventListener('click', function () {
62+
checkForUpdates(true);
63+
});
64+
6065
// 添加项目按钮
6166
document.getElementById('add-keyword').addEventListener('click', function () {
6267
showInlineInput('keyword-list', function (val) {
@@ -446,12 +451,12 @@ function setupDelaySlider() {
446451
}
447452

448453
// ===================== 自动更新 =====================
449-
async function checkForUpdates() {
454+
async function checkForUpdates(manual = false) {
450455
if (!window.__TAURI__) return;
451456

452457
try {
453458
const { check } = window.__TAURI__.updater;
454-
const { ask } = window.__TAURI__.dialog;
459+
const { ask, message } = window.__TAURI__.dialog;
455460
const { relaunch } = window.__TAURI__.process;
456461

457462
const update = await check();
@@ -471,9 +476,23 @@ async function checkForUpdates() {
471476
await update.downloadAndInstall();
472477
await relaunch();
473478
}
479+
} else if (manual) {
480+
// 手动检查时,如果没有更新也要提示
481+
await message('当前已是最新版本!', {
482+
title: 'AutoCode 更新',
483+
kind: 'info'
484+
});
474485
}
475486
} catch (error) {
476487
console.log('检查更新失败:', error);
488+
if (manual) {
489+
// 手动检查时显示错误
490+
const { message } = window.__TAURI__.dialog;
491+
await message('检查更新失败,请稍后重试', {
492+
title: 'AutoCode 更新',
493+
kind: 'error'
494+
});
495+
}
477496
}
478497
}
479498

0 commit comments

Comments
 (0)