feat: AI沙箱流式对话+引导学习+静态服务优化

- 后端: AI沙箱流式对话(SSE), reasoning_content 回退支持
- 前端: 沙箱页流式渲染, 引导学习面板, 默认场景/Starter兜底
- 优化: 前端改用静态文件服务器(node server.js)替代next dev, CSS永不丢失
- 修复: 通用模型默认改为可用模型, predev不再删.next缓存
This commit is contained in:
yuzhiran-dev
2026-05-27 18:26:30 +08:00
parent 0b66d752ce
commit 417fb266d4
14 changed files with 947 additions and 203 deletions
@@ -107,13 +107,18 @@ export class OperationsController {
}
@Put('config/:key')
async updateConfig(@Param('key') key: string, @Body() body: { value: string }) {
async updateConfig(@Param('key') key: string, @Body() body: { value: string; description?: string; category?: string }) {
const existing = await this.prisma.systemConfig.findUnique({ where: { key } });
if (existing) {
return this.prisma.systemConfig.update({ where: { key }, data: { value: body.value } });
return this.prisma.systemConfig.update({ where: { key }, data: { value: body.value, ...(body.description !== undefined ? { description: body.description } : {}) } });
}
return this.prisma.systemConfig.create({
data: { key, value: body.value, category: 'other' },
data: { key, value: body.value, category: body.category || 'other', description: body.description || '' },
});
}
@Delete('config/:key')
async deleteConfig(@Param('key') key: string) {
return this.prisma.systemConfig.delete({ where: { key } });
}
}