feat(desktop): isolate private data by account
This commit is contained in:
parent
3e317745b5
commit
1d2a8a2f63
12 changed files with 143 additions and 60 deletions
|
|
@ -452,22 +452,10 @@ pub async fn select_and_import_knowledge_folder(
|
|||
}
|
||||
|
||||
fn knowledge_roots(app: &AppHandle) -> Result<(PathBuf, Option<PathBuf>), String> {
|
||||
let native = app
|
||||
.path()
|
||||
.app_data_dir()
|
||||
.map_err(|error| format!("HOLOLAKE_APP_DATA_UNAVAILABLE: {error}"))?
|
||||
.join("knowledge-v1");
|
||||
let native = crate::authenticated_storage::account_storage_root(app, "knowledge-v1")?;
|
||||
ensure_native_knowledge_root(&native)?;
|
||||
let legacy = dirs::home_dir()
|
||||
.map(|home| {
|
||||
home.join("Library")
|
||||
.join("Application Support")
|
||||
.join("hololake-desktop")
|
||||
.join("data")
|
||||
.join("knowledge-base")
|
||||
})
|
||||
.filter(|path| path.join("docs").is_dir());
|
||||
Ok((native, legacy))
|
||||
// 旧全局知识库不得自动投影给任一新登录账号;后续只允许用户显式迁移。
|
||||
Ok((native, None))
|
||||
}
|
||||
|
||||
/// 写私有文件的跨平台选项:unix 上只许本人读写,Windows 上不做额外权限设置。
|
||||
|
|
|
|||
Loading…
Reference in a new issue