修改页面加载问题

This commit is contained in:
hjjjj 2026-01-27 10:51:47 +08:00
parent d72991aa95
commit f29521d327
3 changed files with 27 additions and 7 deletions

View File

@ -13,7 +13,8 @@
"Bash(node:*)",
"Bash(netstat:*)",
"Bash(tail:*)",
"Bash(tasklist:*)"
"Bash(tasklist:*)",
"Bash(taskkill:*)"
]
}
}

View File

@ -71,7 +71,7 @@ class Settings(BaseSettings):
# ============================================
# Skill 存储配置
# ============================================
skills_dir: str = "./skills_storage"
skills_dir: str = os.path.join(os.path.dirname(os.path.dirname(__file__)), "skills_storage")
@property
def cors_origins(self) -> List[str]:

View File

@ -125,12 +125,31 @@ export const SkillManagement = () => {
useEffect(() => {
fetchSkills()
// 轮询技能生成任务
const interval = setInterval(async () => {
await fetchSkillGenerationTasks()
}, 3000) // 每3秒检查一次
// 轮询技能生成任务 - 使用递归 setTimeout 而不是 setInterval
// 这样可以确保前一个请求完成后才开始下一个请求
let isMounted = true
return () => clearInterval(interval)
const pollTasks = async () => {
if (!isMounted) return
try {
await fetchSkillGenerationTasks()
} catch (error) {
console.error('Error polling tasks:', error)
}
// 等待 3 秒后再次轮询
if (isMounted) {
setTimeout(pollTasks, 3000)
}
}
// 启动轮询
pollTasks()
return () => {
isMounted = false
}
}, [])
// 获取技能生成任务