Commit dfe3fdc1 authored by erio's avatar erio
Browse files

fix(channel): 模型限制以原始请求模型检查定价列表,而非映射后模型

开启 restrict_models 时,应用原始模型名查定价列表;
定价列表未命中即拒绝,不因通配符映射而绕过限制。
parent 705131e1
...@@ -429,8 +429,9 @@ func (s *ChannelService) ResolveChannelMappingAndRestrict(ctx context.Context, g ...@@ -429,8 +429,9 @@ func (s *ChannelService) ResolveChannelMappingAndRestrict(ctx context.Context, g
if groupID == nil { if groupID == nil {
return mapping, false return mapping, false
} }
// 先用原始模型检查定价列表限制,再做映射
restricted := s.IsModelRestricted(ctx, *groupID, model)
mapping = s.ResolveChannelMapping(ctx, *groupID, model) mapping = s.ResolveChannelMapping(ctx, *groupID, model)
restricted := s.IsModelRestricted(ctx, *groupID, mapping.MappedModel)
return mapping, restricted return mapping, restricted
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment