diff --git a/Html/apps/services/asectrl_service.py b/Html/apps/services/asectrl_service.py index b34982c..8c79d82 100644 --- a/Html/apps/services/asectrl_service.py +++ b/Html/apps/services/asectrl_service.py @@ -31,11 +31,10 @@ def on_connect_to_ase(client, entry, init_data, **kwargs): namespace_entry, ase_client = entry 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) diff --git a/Html/apps/static/js/chatbox.js b/Html/apps/static/js/chatbox.js index 029a22b..cab3b6b 100644 --- a/Html/apps/static/js/chatbox.js +++ b/Html/apps/static/js/chatbox.js @@ -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');