移动端拍照上传、奥数区、学段约束解题与 AI 模型配置。
- 手机/平板响应式布局,支持拍照与相册上传 - 学生详情新增奥数区,按初/高中学段生成解法并禁止超纲 - 系统设置可配置 Ollama 或 OpenAI 兼容 API - 更新 frontend/dist 与使用说明
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import axios from 'axios'
|
||||
import type {
|
||||
AdminUser,
|
||||
AIProvider,
|
||||
Exam,
|
||||
PublicSettings,
|
||||
ScoreInput,
|
||||
@@ -12,6 +13,7 @@ import type {
|
||||
TrendResponse,
|
||||
User,
|
||||
WrongQuestion,
|
||||
WrongQuestionCategory,
|
||||
} from '../types'
|
||||
import type { ExamType } from '../types'
|
||||
|
||||
@@ -68,8 +70,15 @@ export const settingsApi = {
|
||||
|
||||
export const adminApi = {
|
||||
getSettings: () => api.get<SystemSettings>('/admin/settings'),
|
||||
updateSettings: (data: { registration_enabled?: boolean }) =>
|
||||
api.patch<SystemSettings>('/admin/settings', data),
|
||||
updateSettings: (data: {
|
||||
registration_enabled?: boolean
|
||||
ai_provider?: AIProvider
|
||||
ollama_base_url?: string | null
|
||||
ollama_model?: string | null
|
||||
openai_base_url?: string | null
|
||||
openai_model?: string | null
|
||||
openai_api_key?: string
|
||||
}) => api.patch<SystemSettings>('/admin/settings', data),
|
||||
updateProfile: (data: {
|
||||
username?: string
|
||||
current_password?: string
|
||||
@@ -120,11 +129,12 @@ export const examApi = {
|
||||
}
|
||||
|
||||
export const wrongQuestionApi = {
|
||||
list: (studentId: string, params?: { subject_id?: number; q?: string }) =>
|
||||
list: (studentId: string, params?: { subject_id?: number; q?: string; category?: WrongQuestionCategory }) =>
|
||||
api.get<WrongQuestion[]>(`/students/${studentId}/wrong-questions`, { params }),
|
||||
upload: (studentId: string, subjectId: number, file: File) => {
|
||||
upload: (studentId: string, subjectId: number, file: File, category: WrongQuestionCategory = 'regular') => {
|
||||
const form = new FormData()
|
||||
form.append('subject_id', String(subjectId))
|
||||
form.append('category', category)
|
||||
form.append('file', file)
|
||||
return api.post<WrongQuestion>(`/students/${studentId}/wrong-questions`, form)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user