From 2dffeebb60078f6ee1d59ac327c0ecce3fd200e9 Mon Sep 17 00:00:00 2001 From: lingling <kety1122@163.com> Date: 星期一, 17 三月 2025 17:44:03 +0800 Subject: [PATCH] 添加后端用户逻辑 --- LifePayment/LifePayment.HttpApi/LifePay/AccountController.cs | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/LifePayment/LifePayment.HttpApi/LifePay/AccountController.cs b/LifePayment/LifePayment.HttpApi/LifePay/AccountController.cs index c786435..5737e00 100644 --- a/LifePayment/LifePayment.HttpApi/LifePay/AccountController.cs +++ b/LifePayment/LifePayment.HttpApi/LifePay/AccountController.cs @@ -1,4 +1,6 @@ -锘縰sing LifePayment.Application.Contracts; +锘縰sing LifePayment.Application; +using LifePayment.Application.Contracts; +using LifePayment.Domain.Shared; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; @@ -7,6 +9,8 @@ using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.WebClientInfo; +using Volo.Abp.Identity.Application.Contracts.Account; +using Volo.Abp.IdentityModel; namespace LifePayment.HttpApi { @@ -15,19 +19,20 @@ public class AccountController : AbpController { private readonly IAccountService _accountService; - + private readonly OssSettings ossSettings; private readonly IWebClientInfoProvider _webClientInfoProvider; + public AccountController( IAccountService accountService, - + IOptionsMonitor<OssSettings> optionsMonitor, IWebClientInfoProvider webClientInfoProvider ) { _accountService = accountService; - + this.ossSettings = optionsMonitor.CurrentValue; _webClientInfoProvider = webClientInfoProvider; } @@ -60,7 +65,19 @@ return await _accountService.LifePayPhoneMesssageCodeLogin(input); } + [HttpPost] + public OssSTSReponse GetOssSTS() + { + OssSTSHelper ossSTSHelper = new OssSTSHelper(this.ossSettings); + return ossSTSHelper.GetOssSTS(); + } + [HttpPost] + public async Task<IdentityModelTokenCacheItem> GetTokenForWeb(AccessRequestDto accessRequestDto) + { + var webClientIp = _webClientInfoProvider.ClientIpAddress; + return await _accountService.GetTokenForWeb(accessRequestDto, webClientIp); + } #endregion -- Gitblit v1.9.1