mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-12-27 02:25:58 +08:00
优化聊天会话管理,支持 websocket 断开重连之后能继续连接会话上下文
This commit is contained in:
@@ -2,15 +2,14 @@
|
||||
/**
|
||||
* storage handler
|
||||
*/
|
||||
import Storage from 'good-storage'
|
||||
|
||||
const SessionIdKey = 'ChatGPT_SESSION_ID';
|
||||
export const Global = {}
|
||||
|
||||
export function getSessionId() {
|
||||
return Storage.get(SessionIdKey)
|
||||
return sessionStorage.getItem(SessionIdKey)
|
||||
}
|
||||
|
||||
export function setSessionId(value) {
|
||||
Storage.set(SessionIdKey, value)
|
||||
sessionStorage.setItem(SessionIdKey, value)
|
||||
}
|
||||
Reference in New Issue
Block a user