diff --git a/app.py b/app.py index ae1d21c..f90fb1c 100644 --- a/app.py +++ b/app.py @@ -34,7 +34,7 @@ DATA_DIR = os.path.join(BASE_DIR, "data").replace("\\", "/") DB_PATH = os.path.join(DATA_DIR, "miniapp_v3.db").replace("\\", "/") VIDEOS_PATH = os.path.join(DATA_DIR, "seed_videos.json").replace("\\", "/") STORY_PATH = os.path.join(DATA_DIR, "seed_story.json").replace("\\", "/") -MATH_TEEN_STORY_PATH = os.path.join(DATA_DIR, "数学少年线_story.json").replace("\\", "/") +MATH_TEEN_STORY_PATH = os.path.join(BASE_DIR, "docs", "数学少年线_story.json").replace("\\", "/") SIMULATOR_PATH = os.path.join(DATA_DIR, "seed_simulator.json").replace("\\", "/") MATHBTI_PATH = os.path.join(DATA_DIR, "seed_mathbti.json").replace("\\", "/") ALUMNI_PATH = os.path.join(DATA_DIR, "seed_alumni.json").replace("\\", "/") diff --git a/data/miniapp_v3.db b/data/miniapp_v3.db index 7bc2167..73b77df 100644 Binary files a/data/miniapp_v3.db and b/data/miniapp_v3.db differ diff --git a/static/js/desktop.js b/static/js/desktop.js index 982403f..e28ddb0 100644 --- a/static/js/desktop.js +++ b/static/js/desktop.js @@ -528,7 +528,7 @@ async function rH(type,id,title){try{await api('/api/history',{method:'POST',bod // ===== Profile ===== async function loadProfile(){chatCtx={};try{const[pr,sr]=await Promise.all([api('/api/user/profile?user_id='+USER_ID),api('/api/user/stats?user_id='+USER_ID)]);const p=pr.code===0?pr.data:{nickname:'游客用户',avatar_emoji:'葫',avatar_color:'#5B6AF0'};const s=sr.code===0?sr.data:{watch_count:0,favorite_count:0};document.getElementById('profileContent').innerHTML='
加载失败
'}} -async function sP(){const n=document.getElementById('editNickname').value.trim();const a=document.getElementById('editAvatar').value.trim();try{await api('/api/user/profile',{method:'POST',body:{user_id:USER_ID,nickname:n,avatar_emoji:a}});document.getElementById('sidebarName').textContent=n||'游客用户';document.getElementById('sidebarAvatar').textContent=a||'葫';alert('保存成功');loadProfile()}catch(e){alert('保存失败')}} +async function sP(){const n=document.getElementById('editNickname').value.trim();const a=document.getElementById('editAvatar').value.trim();try{await api('/api/user/profile',{method:'POST',body:{user_id:USER_ID,nickname:n,avatar_emoji:a}});document.getElementById('sidebarName').textContent=n||'游客用户';document.getElementById('sidebarAvatar').textContent=a||'葫';alert('保存成功');if(CP==='mine')loadMine();else loadProfile()}catch(e){alert('保存失败')}} // ===== Card Collection Page ===== async function loadCardsPage(){ diff --git a/templates/desktop.html b/templates/desktop.html index 6255024..726d0d9 100644 --- a/templates/desktop.html +++ b/templates/desktop.html @@ -165,7 +165,7 @@ - +