diff --git a/frontend/composables/useApi.js b/frontend/composables/useApi.js index fd0c747..87a7798 100644 --- a/frontend/composables/useApi.js +++ b/frontend/composables/useApi.js @@ -397,6 +397,7 @@ export const useApi = () => { const getSavedKeys = async (params = {}) => { const query = new URLSearchParams() if (params && params.account) query.set('account', params.account) + if (params && params.db_storage_path) query.set('db_storage_path', params.db_storage_path) const url = '/keys' + (query.toString() ? `?${query.toString()}` : '') return await request(url) } @@ -547,8 +548,11 @@ export const useApi = () => { } // 获取数据库密钥 - const getKeys = async () => { - return await request('/get_keys') + const getKeys = async (params = {}) => { + const query = new URLSearchParams() + if (params && params.wechat_install_path) query.set('wechat_install_path', params.wechat_install_path) + const url = '/get_keys' + (query.toString() ? `?${query.toString()}` : '') + return await request(url) } // 获取图片密钥 diff --git a/frontend/lib/wechat-install-path.js b/frontend/lib/wechat-install-path.js new file mode 100644 index 0000000..8d13b97 --- /dev/null +++ b/frontend/lib/wechat-install-path.js @@ -0,0 +1,24 @@ +export const WECHAT_INSTALL_PATH_STORAGE_KEY = 'decrypt.wechatInstallPath' + +export const normalizeWechatInstallPath = (value) => String(value || '').trim() + +export const readStoredWechatInstallPath = () => { + if (!process.client || typeof window === 'undefined') return '' + try { + return normalizeWechatInstallPath(window.localStorage.getItem(WECHAT_INSTALL_PATH_STORAGE_KEY) || '') + } catch { + return '' + } +} + +export const writeStoredWechatInstallPath = (value) => { + if (!process.client || typeof window === 'undefined') return + try { + const normalized = normalizeWechatInstallPath(value) + if (normalized) { + window.localStorage.setItem(WECHAT_INSTALL_PATH_STORAGE_KEY, normalized) + } else { + window.localStorage.removeItem(WECHAT_INSTALL_PATH_STORAGE_KEY) + } + } catch {} +} diff --git a/frontend/pages/decrypt.vue b/frontend/pages/decrypt.vue index 3502c4a..c4521f3 100644 --- a/frontend/pages/decrypt.vue +++ b/frontend/pages/decrypt.vue @@ -73,6 +73,12 @@ 点击按钮将自动获取【数据库解密密钥】。您也可以手动输入已知的64位密钥。
++ + 当前将使用第一步检测时保存的微信安装目录:{{ formData.wechat_install_path }}。 +
@@ -655,6 +661,7 @@