feat(ui): 状态栏「检查更新」左边显示当前版本号(v2.6.5)
老板要求:检查更新左侧加入当前版本的版本号。
· index.html:在 UTF-8 和「检查更新」之间加 <span id="st-ver">,
静态值只是兜底(无 JS / Electron 版时的显示)
· main.rs:新增 app_version 命令,直接读 AppHandle 的 package_info,
不联网、不读配置文件 —— 保证显示的版本和程序本体一致
· tauri-bridge.js:启动时 invoke('app_version') 覆盖静态值
状态栏现在是:
0 字 | 0 字符 | 第 1 行, 第 1 列 | UTF-8 | v2.6.5 | 检查更新
官网截图同步重出(旧图的状态栏没有版本号),四张合计 548KB。
已构建发布 2.6.5:xymd_2.6.5.exe + .sig,签名实验通过。
This commit is contained in:
1 parent
5236a44b79
commit
6aa1689574
13 files changed
+30
-13
No files matched your search
Generated
+1
-1
@@ -5370,7 +5370,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "xiaoyin-markdown"
|
||||
version = "2.6.4"
|
||||
version = "2.6.5"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"clipboard-win",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "xiaoyin-markdown"
|
||||
version = "2.6.4"
|
||||
version = "2.6.5"
|
||||
description = "小银 Markdown —— 轻量本地 Markdown 编辑器"
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -472,6 +472,12 @@ struct UpdateStatus {
|
||||
date: String,
|
||||
}
|
||||
|
||||
/// 当前程序版本(状态栏显示用,不联网)
|
||||
#[tauri::command]
|
||||
fn app_version(app: AppHandle) -> String {
|
||||
app.package_info().version.to_string()
|
||||
}
|
||||
|
||||
/// 查 https://md.wangjinding.com/update/latest.json 有没有比当前新的版本。
|
||||
/// 用官方 updater 插件:带 minisign 签名校验,装的是签名过的安装包,避免被中间人替换。
|
||||
#[tauri::command]
|
||||
@@ -587,6 +593,7 @@ fn main() {
|
||||
force_close,
|
||||
get_window_count,
|
||||
migrate_apply,
|
||||
app_version,
|
||||
check_update,
|
||||
install_update
|
||||
])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "XiaoyinMarkdown",
|
||||
"version": "2.6.4",
|
||||
"version": "2.6.5",
|
||||
"identifier": "com.xiaoyin.markdown",
|
||||
"build": {
|
||||
"frontendDist": "../src/renderer"
|
||||
|
||||
Reference in new issue
Block a user