From 482dd73afd7991dea1f6af0105f1f9b5084ed0df Mon Sep 17 00:00:00 2001 From: ccnetcore Date: Fri, 15 Aug 2025 23:41:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=B6=E8=87=AA=E5=AE=9A=E4=B9=89=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AE=9D=E5=9B=9E=E8=B0=83=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/Pay/CreateOrderInput.cs | 2 ++ .../Yi.Framework.AiHub.Application/Services/PayService.cs | 3 ++- .../Yi.Framework.AiHub.Domain/Alipay/AlipayManager.cs | 8 +++----- Yi.Ai.Vue3/types/import_meta.d.ts | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/Dtos/Pay/CreateOrderInput.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/Dtos/Pay/CreateOrderInput.cs index d2e85949..b6759ede 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/Dtos/Pay/CreateOrderInput.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/Dtos/Pay/CreateOrderInput.cs @@ -13,4 +13,6 @@ public class CreateOrderInput /// [Required] public GoodsTypeEnum GoodsType { get; set; } + + public string? ReturnUrl{ get; set; } } \ No newline at end of file diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/PayService.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/PayService.cs index 77e00f93..ec4b3d4b 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/PayService.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/PayService.cs @@ -58,7 +58,8 @@ public class PayService : ApplicationService, IPayService var paymentPageHtml = await _alipayManager.PaymentPageAsync( order.GoodsName, order.OutTradeNo, - order.TotalAmount); + order.TotalAmount, + input.ReturnUrl); // 3. 返回结果 return new CreateOrderOutput diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Alipay/AlipayManager.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Alipay/AlipayManager.cs index 5a36122c..345f5261 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Alipay/AlipayManager.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Alipay/AlipayManager.cs @@ -10,12 +10,10 @@ namespace Yi.Framework.AiHub.Domain.Alipay; public class AlipayManager : DomainService { private readonly ILogger _logger; - private readonly IConfiguration _configuration; - public AlipayManager(ILogger logger, IConfiguration configuration) + public AlipayManager(ILogger logger) { _logger = logger; - _configuration = configuration; } /// @@ -24,13 +22,13 @@ public class AlipayManager : DomainService /// /// public Task PaymentPageAsync(string productName, string orderNumber, - decimal totalAmount) + decimal totalAmount, string? returnUrl) { try { // 2. 发起API调用(以创建当面付收款二维码为例) var response = Factory.Payment.Page() - .Pay(productName, orderNumber, totalAmount.ToString(), _configuration["Alipay:ReturnUrl"]); + .Pay(productName, orderNumber, totalAmount.ToString(), returnUrl ?? string.Empty); // 3. 处理响应或异常 if (ResponseChecker.Success(response)) { diff --git a/Yi.Ai.Vue3/types/import_meta.d.ts b/Yi.Ai.Vue3/types/import_meta.d.ts index d8a60d41..b3e9d275 100644 --- a/Yi.Ai.Vue3/types/import_meta.d.ts +++ b/Yi.Ai.Vue3/types/import_meta.d.ts @@ -6,7 +6,6 @@ interface ImportMetaEnv { readonly VITE_WEB_ENV: string; readonly VITE_WEB_BASE_API: string; readonly VITE_API_URL: string; - readonly VITE_BUILD_COMPRESS: string; readonly VITE_SSO_SEVER_URL: string; readonly VITE_APP_VERSION: string; }