重构AI配置并修复前端类型错误

1. 删除AIConfig中未使用的属性(BaseURL、Model)
2. 修复ExamManagement页面Tag组件的size属性错误
3. 添加shared_by.nickname类型定义
4. 优化AI评分提示词,移除冗余的评分依据列表

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
燕陇琪 2025-11-18 22:23:00 +08:00
parent 1107d5d81c
commit 4ac3243f6e
3 changed files with 1 additions and 24 deletions

View File

@ -78,15 +78,6 @@ func (s *BaiduAIGradingService) GradeEssay(question, userAnswer string) (*AIGrad
学生答案:%s
评分依据:
请依据以下保密法律法规和管理制度进行分析和评分:
1. 中华人民共和国保守国家秘密法
2. 中华人民共和国保守国家秘密法实施条例
3. 保密工作管理制度2025.9.9
4. 软件开发管理制度
5. 涉密信息系统集成资质保密标准
6. 涉密信息系统集成资质管理办法
评分标准(论述题没有固定标准答案,请根据答题质量和法规符合度评分):
1. 论点是否明确,是否符合保密法规要求(30)
2. 内容是否充实,论据是否引用相关法规条文(30)
@ -213,14 +204,6 @@ func (s *BaiduAIGradingService) ExplainQuestionStream(writer http.ResponseWriter
标准答案:%s
**重要依据**:请基于以下保密法律法规和管理制度进行专业分析:
1. 中华人民共和国保守国家秘密法
2. 中华人民共和国保守国家秘密法实施条例
3. 保密工作管理制度2025.9.9
4. 软件开发管理制度
5. 涉密信息系统集成资质保密标准
6. 涉密信息系统集成资质管理办法
请提供一个详细的解析,要求:
1. **必须基于保密法规**:解析时必须引用相关法规条文,说明依据哪些具体法律法规
2. **必须实事求是**:只基于题目内容标准答案和实际法规进行解析

View File

@ -18,9 +18,7 @@ type DatabaseConfig struct {
// AIConfig AI服务配置结构
type AIConfig struct {
BaseURL string
APIKey string
Model string
BaiduAppID string // 百度云AppBuilder应用ID
}
@ -79,15 +77,11 @@ func (c *DatabaseConfig) GetDSN() string {
// GetAIConfig 获取AI服务配置
// 优先使用环境变量,如果没有设置则使用默认值
func GetAIConfig() *AIConfig {
baseURL := getEnv("AI_BASE_URL", "http://172.20.0.117")
apiKey := getEnv("AI_API_KEY", "bce-v3/ALTAK-TgZ1YSBmbwNXo3BIuzNZ2/768b777896453e820a2c46f38614c8e9bf43f845")
model := getEnv("AI_MODEL", "deepseek-v3")
baiduAppID := getEnv("BAIDU_APP_ID", "7b336aaf-f448-46d6-9e5f-bb9e38a1167c")
return &AIConfig{
BaseURL: baseURL,
APIKey: apiKey,
Model: model,
BaiduAppID: baiduAppID,
}
}

View File

@ -51,6 +51,7 @@ interface ExamListItem {
shared_by?: {
id: number
username: string
nickname?: string
}
}
@ -299,7 +300,6 @@ const ExamManagement: React.FC = () => {
<Tag
icon={<ShareAltOutlined />}
color="purple"
size="small"
className={styles.shareTag}
>
{exam.shared_by.nickname || exam.shared_by.username}