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; }