From 22c283807ae9dbb3bd772767d883ea8100e317d1 Mon Sep 17 00:00:00 2001 From: zzh <1368735060@qq.com> Date: Thu, 19 Nov 2026 19:30:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=93=81=E7=89=8C=20Logo=20=E4=B8=8E?= =?UTF-8?q?=E5=85=85=E5=80=BC=E6=94=B6=E6=AC=BE=E7=A0=81=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=8C=89=E6=B8=A0=E9=81=93=E6=B8=85=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 brand-logo/clear、payment-qr/clear,清空后前端可回退文字 LOGO / 空态。 Co-authored-by: Cursor --- .../System/SystemOtherConfigService.cs | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/Oms.Application/Services/System/SystemOtherConfigService.cs b/src/Oms.Application/Services/System/SystemOtherConfigService.cs index d091e30..036b02b 100644 --- a/src/Oms.Application/Services/System/SystemOtherConfigService.cs +++ b/src/Oms.Application/Services/System/SystemOtherConfigService.cs @@ -198,6 +198,37 @@ public class SystemOtherConfigService : ApplicationService }; } + /// + /// 清除指定渠道充值收款码。Channel=alipay|wechat;清除后对应 URL 为空。 + /// + /// 渠道:alipay / wechat。 + [HttpPost("/system/other-config/payment-qr/clear")] + public async Task ClearPaymentReceiveQrAsync([FromQuery] string channel) + { + var normalized = (channel ?? string.Empty).Trim().ToLowerInvariant(); + if (normalized is not (PaymentQrChannelAlipay or PaymentQrChannelWechat)) + { + throw new BusinessException("渠道仅支持 alipay 或 wechat"); + } + + var entity = await EnsurePaymentReceiveQrConfigAsync(); + if (normalized == PaymentQrChannelAlipay) + { + entity.AppKey = null; + } + else + { + entity.Remark = null; + } + + await SystemOtherConfigRepository.UpdateAsync(entity); + return new PaymentReceiveQrOutput + { + AlipayUrl = FileStorage.GetPublicUrl(entity.AppKey), + WechatUrl = FileStorage.GetPublicUrl(entity.Remark) + }; + } + /// /// 获取品牌 Logo(系统顶栏 / 官网 / 网站标签 / 启动页吉祥物)。未配置时对应 URL 为空(前端回退本地默认图)。匿名可读。 /// @@ -252,6 +283,45 @@ public class SystemOtherConfigService : ApplicationService return MapBrandLogoOutput(entity); } + /// + /// 清除指定渠道的品牌 Logo。Channel=portal|site|favicon|mascot;清除后前端显示文字 LOGO。 + /// + /// 渠道:portal / site / favicon / mascot。 + [HttpPost("/system/other-config/brand-logo/clear")] + public async Task ClearBrandLogoAsync([FromQuery] string channel) + { + var normalized = (channel ?? string.Empty).Trim().ToLowerInvariant(); + if (normalized is not ( + BrandLogoChannelPortal + or BrandLogoChannelSite + or BrandLogoChannelFavicon + or BrandLogoChannelMascot)) + { + throw new BusinessException("渠道仅支持 portal、site、favicon 或 mascot"); + } + + var entity = await EnsureBrandLogoConfigAsync(); + if (normalized == BrandLogoChannelPortal) + { + entity.AppKey = null; + } + else if (normalized == BrandLogoChannelSite) + { + entity.Remark = null; + } + else if (normalized == BrandLogoChannelFavicon) + { + entity.BaseUrl = null; + } + else + { + entity.AppSecret = null; + } + + await SystemOtherConfigRepository.UpdateAsync(entity); + return MapBrandLogoOutput(entity); + } + private BrandLogoOutput MapBrandLogoOutput(SystemOtherConfig? entity) => new() { -- 2.45.2