restart with clear user_session

This commit is contained in:
CakeCN
2025-12-11 22:37:58 +08:00
parent f9b3cf53da
commit c4743bcadd
2 changed files with 1 additions and 3 deletions

View File

@@ -32,10 +32,9 @@ def on_connect_to_ase(client, entry, init_data, **kwargs):
namespace_entry.emit('open-iframe',"", room=init_data['room'], namespace='/agent')
namespace_entry.emit('message', "Agents服务已连接, 加载教案中", room=init_data['room'], namespace='/agent')
clear_user_session(init_data['asengine_url'], init_data['asengine_token'], init_data['room'])
restart = init_data.get("restart", False)
if restart: # 重启时,从-1章进入 0章
clear_user_session(init_data['asengine_url'], init_data['asengine_token'], init_data['room'])
ase_client.chatmanager.next_chapter()
ase_client.chatmanager.load_now_chapter(load_code=restart)
print("load_now_chapter with restart:", restart)

View File

@@ -424,7 +424,6 @@ window.addEventListener('beforeunload', () => {
let currentChapterIndex = -1;
function next_chapter(data) {
// 直接获取页面中的 h3 元素(不再使用 iframe
var container = document.getElementById('markdown-content-container');
var titles = [];
var h3Elements = container.querySelectorAll('h3');