fix: _init_graph 更新 _db_path 修复用户隔离

问题:
- _init_graph 正确解析了用户 DB 路径,但未更新 self._db_path
- web_api.py 的 create_server() 用 backend_server._db_path 创建 graph_db
- 导致所有用户共用一个 CWD/graph_memory.db(回忆图谱页面数据混在一起)
- 同时 jianf 的 config.json 首次创建时空 apikey,未正确写回

修复:
- _init_graph 解析用户路径后,同步更新 self._db_path
- 现在各用户 graph_db 和 config.json 完全隔离
This commit is contained in:
root
2026-04-28 20:56:01 +08:00
parent 12ab1df7f5
commit 1a394ddd2b

View File

@ -217,6 +217,7 @@ class BackendServer:
temp_db.close()
if user_info and user_info.get('db_path'):
db_path = user_info['db_path']
self._db_path = db_path # 更新 _db_path供外部如 web_api.py获取正确的路径
except Exception:
pass # 如果获取失败,使用默认路径