fix: 修复图片解析、角色Claim类型及错误日志问题

- 优化 Gemini 图片解析逻辑,递归遍历 JSON 并支持从 markdown 中提取图片
- 修复管理员角色 Claim 使用错误类型的问题,统一为 ClaimTypes.Role
- 修正图片生成失败时日志内容,输出完整响应数据以便排查
This commit is contained in:
ccnetcore
2026-01-18 17:21:07 +08:00
parent 127639c20e
commit 09ecddb552
3 changed files with 126 additions and 26 deletions

View File

@@ -1080,7 +1080,7 @@ public class AiGateWayManager : DomainService
var imagePrefixBase64 = GeminiGenerateContentAcquirer.GetImagePrefixBase64(data);
if (string.IsNullOrWhiteSpace(imagePrefixBase64))
{
_logger.LogError($"图片生成解析失败模型id:,请求信息:【{request}】,请求响应信息:{imagePrefixBase64}");
_logger.LogError($"图片生成解析失败模型id:,请求信息:【{request}】,请求响应信息:【{data}】");
throw new UserFriendlyException("大模型没有返回图片,请调整提示词或稍后再试");
}