Update config.go

This commit is contained in:
公明 2025-02-27 16:24:17 +08:00 committed by GitHub
parent 32f2449452
commit f27bc60ef3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,16 +3,15 @@ package config
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil"
"os" "os"
) )
// 配置结构 // 配置结构
type Config struct { type Config struct {
AI string `json:"AI"` AI string `json:"AI"`
Cookie2 string `json:"cookie2"` Headers2 map[string]string `json:"headers2"`
Suffixes []string `json:"suffixes"` Suffixes []string `json:"suffixes"`
AllowedRespHeaders []string `json:"allowedRespHeaders"` AllowedRespHeaders []string `json:"allowedRespHeaders"`
APIKeys struct { APIKeys struct {
Kimi string `json:"kimi"` Kimi string `json:"kimi"`
DeepSeek string `json:"deepseek"` DeepSeek string `json:"deepseek"`
@ -63,7 +62,7 @@ var Prompt = `{"role": "你是一个AI负责通过比较两个HTTP响应数
// 加载配置文件 // 加载配置文件
func loadConfig(filePath string) error { func loadConfig(filePath string) error {
data, err := ioutil.ReadFile(filePath) data, err := os.ReadFile(filePath)
if err != nil { if err != nil {
return err return err
} }