feat: add New API channel support
This commit is contained in:
@@ -481,6 +481,10 @@ func validateChannel(channel *model.Channel, isAdd bool) error {
|
||||
return fmt.Errorf("渠道额外设置[channel setting] 格式错误:%s", err.Error())
|
||||
}
|
||||
|
||||
if channel.Type == constant.ChannelTypeNewAPI && strings.TrimSpace(channel.GetBaseURL()) == "" {
|
||||
return fmt.Errorf("New API channel base URL cannot be empty")
|
||||
}
|
||||
|
||||
// 如果是添加操作,检查 channel 和 key 是否为空
|
||||
if isAdd {
|
||||
if channel.Key == "" {
|
||||
|
||||
Reference in New Issue
Block a user