Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
g122622 committed Feb 18, 2024
1 parent 64a1993 commit bb79b93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/api/core/adapters/gcryptV1/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Created Date: 2023-11-26 17:14:30
* Author: Guoyi
* -----
* Last Modified: 2024-02-16 11:01:43
* Last Modified: 2024-02-18 23:41:34
* Modified By: Guoyi
* -----
* Copyright (c) 2024 Guoyi Inc.
Expand Down Expand Up @@ -45,11 +45,15 @@ class GcryptV1Adapter implements AdapterBase {
items: []
}
await this.KVPEngine.setData("entryKey", Buffer.from(entryKey))
console.log("adapter.js-1")
await this.KVPEngine.setData(entryKey, Buffer.from(JSON.stringify(fileTableData)))
console.log("adapter.js-2")
}

this.currentDirectory = new Addr("")
console.log("adapter.js-3")
this.currentFileTable = await this._getFileTable(this.currentDirectory)
console.log("adapter.js-4")
}

/**
Expand Down Expand Up @@ -105,6 +109,7 @@ class GcryptV1Adapter implements AdapterBase {
return this.cachedFileTables[i].fileTable
}
}
console.log("adapter.ts-5-缓存未命中-final")

// 缓存未命中
if (foo.isRoot()) {
Expand Down
9 changes: 8 additions & 1 deletion src/components/FileMgr/FileMgr.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,16 @@ const ClipBoardRef = ref()
// <生命周期&初始化>
const initAll = () => {
isLoading.value = true
console.log("FileMgr.vue-1")
gotoDir(props.adapter.getCurrentDirectory(), true)
console.log("FileMgr.vue-2")
watch(viewOptions, (newVal, oldVal) => {
// 保存viewOptions
tryToSaveViewOptions(oldVal)
console.log("FileMgr.vue-3")
tryToSaveViewOptions(oldVal).then(() => {
console.log("FileMgr.vue-4")
})
}, { deep: true })
isLoading.value = false
Expand Down Expand Up @@ -479,11 +484,13 @@ const tryToSaveViewOptions = async (optionsIn?: ViewOptions) => {
if (!props.adapter.setExtraMeta || !options.allowSavingViewOptions || !currentFileTable.value) {
return
}
console.log("FileMgr.vue-5")
try {
await props.adapter.setExtraMeta(
currentFileTable.value.selfKey,
'viewOptions',
Buffer.from(JSON.stringify(viewOptions.value ?? optionsIn)))
console.log("FileMgr.vue-6-final")
} catch (e) {
warn('尝试保存布局选项失败' + e.toString())
}
Expand Down
2 changes: 2 additions & 0 deletions src/store/encryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export const useEncryptionStore = defineStore("encryption", {
await encryptionEngine.init(password)
await KVPEngine.init(entryFileSrc, password, encryptionEngine)
await adapter.initAdapter(KVPEngine, adapterGuid)
console.log("encryption.ts-1")
} catch (e) {
console.log(e)
notification.error("加载加密库失败:" + e.toString())
error("加载加密库失败:" + e.toString())
}
Expand Down

0 comments on commit bb79b93

Please sign in to comment.