修改中转站

This commit is contained in:
2025-09-06 17:35:03 +08:00
parent a91b3ebbb2
commit 21c0a9e583
7 changed files with 421 additions and 1179 deletions

View File

@@ -204,15 +204,6 @@ pub fn apply_relay_station_to_config(station: &RelayStation) -> Result<(), Strin
"packycode" => {
// PackyCode 使用原始配置,不做特殊处理
}
"newapi" | "oneapi" => {
// NewAPI 和 OneAPI 兼容 OpenAI 格式,不需要特殊处理
}
"yourapi" => {
// YourAPI 可能需要特殊的路径格式
if !station.api_url.ends_with("/v1") {
config.env.anthropic_base_url = Some(format!("{}/v1", station.api_url));
}
}
"custom" => {
// 自定义适配器,使用原始配置
}

File diff suppressed because it is too large Load Diff

View File

@@ -19,9 +19,6 @@ pub enum RelayStationAdapter {
Glm, // 智谱GLM
Qwen, // 千问Qwen
Kimi, // Kimi k2
Newapi, // NewAPI 兼容平台
Oneapi, // OneAPI 兼容平台
Yourapi, // YourAPI 特定平台
Custom, // 自定义简单配置
}
@@ -33,9 +30,6 @@ impl RelayStationAdapter {
RelayStationAdapter::Glm => "glm",
RelayStationAdapter::Qwen => "qwen",
RelayStationAdapter::Kimi => "kimi",
RelayStationAdapter::Newapi => "newapi",
RelayStationAdapter::Oneapi => "oneapi",
RelayStationAdapter::Yourapi => "yourapi",
RelayStationAdapter::Custom => "custom",
}
}
@@ -60,7 +54,7 @@ pub struct RelayStation {
pub adapter: RelayStationAdapter, // 适配器类型
pub auth_method: AuthMethod, // 认证方式
pub system_token: String, // 系统令牌
pub user_id: Option<String>, // 用户 IDNewAPI 必需
pub user_id: Option<String>, // 用户 ID可选
pub adapter_config: Option<HashMap<String, serde_json::Value>>, // 适配器特定配置
pub enabled: bool, // 启用状态
pub created_at: i64, // 创建时间