fix: return aes_key to frontend

This commit is contained in:
H3CoF6
2026-02-28 00:11:07 +08:00
Unverified
parent 2990e22001
commit a4c8d580eb
4 changed files with 15 additions and 14 deletions
+3 -3
View File
@@ -459,8 +459,8 @@ export const useApi = () => {
}
// 获取数据库密钥
const getDbKey = async () => {
return await request('/get_db_key')
const getKeys = async () => {
return await request('/get_keys')
}
// 获取图片密钥
@@ -509,7 +509,7 @@ export const useApi = () => {
getWrappedAnnual,
getWrappedAnnualMeta,
getWrappedAnnualCard,
getDbKey,
getKeys,
getImageKey,
getWxStatus,
}
+4 -6
View File
@@ -434,7 +434,7 @@
import { ref, reactive, computed, onMounted, onBeforeUnmount } from 'vue'
import { useApi } from '~/composables/useApi'
const { decryptDatabase, saveMediaKeys, getSavedKeys, getDbKey, getImageKey, getWxStatus } = useApi()
const { decryptDatabase, saveMediaKeys, getSavedKeys, getKeys, getImageKey, getWxStatus } = useApi()
const loading = ref(false)
const error = ref('')
@@ -541,7 +541,7 @@ const handleGetDbKey = async () => {
warning.value = '正在启动微信,请确保微信未开启“自动登录”,并在弹窗中正常登录。'
const res = await getDbKey()
const res = await getKeys()
if (res && res.status === 0) {
if (res.data?.db_key) {
@@ -703,13 +703,13 @@ const handleDecrypt = async () => {
if (!validateForm()) {
return
}
loading.value = true
error.value = ''
warning.value = ''
resetDbDecryptProgress()
try {
const canSse = process.client && typeof window !== 'undefined' && typeof EventSource !== 'undefined'
@@ -730,7 +730,6 @@ const handleDecrypt = async () => {
if (accounts.length > 0) mediaAccount.value = accounts[0]
} catch (e) {}
clearManualKeys()
currentStep.value = 1
await prefillKeysForAccount(mediaAccount.value)
@@ -827,7 +826,6 @@ const handleDecrypt = async () => {
loading.value = false
if (data.status === 'completed') {
clearManualKeys()
currentStep.value = 1
await prefillKeysForAccount(mediaAccount.value)