fix: 桌面导出改用 IPC 直写(另存为对话框),设置页显示版本号
This commit is contained in:
@@ -3,6 +3,13 @@ import { Capacitor } from '@capacitor/core'
|
||||
// 导出文本文件:返回落盘位置(原生平台返回文件 URI;浏览器返回空串)
|
||||
// 原生环境写入公共文档目录,失败时回退应用缓存目录
|
||||
export async function downloadText(filename: string, text: string): Promise<string> {
|
||||
// 桌面版(Electron):经主进程直接写盘,弹标准另存为对话框
|
||||
const w = window as unknown as { electronAPI?: { saveFile: (n: string, c: string) => Promise<{ saved: boolean; path: string }> } }
|
||||
if (w.electronAPI && w.electronAPI.saveFile) {
|
||||
const r = await w.electronAPI.saveFile(filename, text)
|
||||
return r && r.saved ? r.path : ''
|
||||
}
|
||||
|
||||
if (Capacitor.isNativePlatform()) {
|
||||
const { Filesystem, Directory, Encoding } = await import('@capacitor/filesystem')
|
||||
try {
|
||||
|
||||
@@ -36,6 +36,7 @@ const newLoginPwd1 = ref('')
|
||||
const newLoginPwd2 = ref('')
|
||||
const accError = ref('')
|
||||
const deleteAccConfirm = ref(false)
|
||||
const appVersion = __APP_VERSION__
|
||||
const syncBase = ref('')
|
||||
const cloudUser = ref('')
|
||||
const syncStatus = ref('')
|
||||
@@ -251,7 +252,7 @@ async function doImport() {
|
||||
<div class="settings">
|
||||
<div class="card section">
|
||||
<div class="section-title">账号与隐私</div>
|
||||
<div class="muted acc-line">当前用户:{{ username }} · 每位用户独立数据库隔离存储于本机 · 登录密码仅保存 PBKDF2 哈希</div>
|
||||
<div class="muted acc-line">版本 v{{ appVersion }} · 当前用户:{{ username }} · 每位用户独立数据库隔离存储于本机 · 登录密码仅保存 PBKDF2 哈希</div>
|
||||
<div class="ai-grid">
|
||||
<div class="rule-item">
|
||||
<label>旧登录密码</label>
|
||||
|
||||
Reference in New Issue
Block a user