zhengyuxuan
2025-04-07 6ae97d768948e197a89492239441feca04c1dbb9
LifePayment/LifePayment.HttpApi/LifePay/AccountController.cs
@@ -1,4 +1,6 @@
using LifePayment.Application.Contracts;
using 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;
        }
@@ -55,12 +60,37 @@
        [HttpPost]
        [AllowAnonymous]
        [ChannelFilter]
        public async Task<Guid> LifePayPhoneMesssageCodeLogin(LifePayPhoneMesssageCodeLoginInput input)
        public async Task<LifePayPhoneMesssageCodeLoginOutput> LifePayPhoneMesssageCodeLogin(LifePayPhoneMesssageCodeLoginInput input)
        {
            return await _accountService.LifePayPhoneMesssageCodeLogin(input);
        }
        /// <summary>
        /// 根据用户ID获取用户是否为后台管理员
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [AllowAnonymous]
        [ChannelFilter]
        public async Task<LifePayPhoneMesssageCodeLoginOutput> LifePayUserMesssageByIduser(LifePayUserMesssageByIduserInput input)
        {
            return await _accountService.LifePayUserMesssageByIduser(input.Id);
        }
        [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