Browse Source

login-page-info 增加应用范围、呼叫中心类型

xf 8 months ago
parent
commit
b85b0355a4

+ 17 - 2
src/Hotline.Api/Controllers/IdentityController.cs

@@ -7,7 +7,9 @@ using System.Security.Cryptography;
 using System.Text;
 using Hotline.Api.Filter;
 using Hotline.Application.Systems;
+using Hotline.Configurations;
 using Hotline.Settings;
+using Microsoft.Extensions.Options;
 using XC.RSAUtil;
 using XF.Domain.Constants;
 using XF.Domain.Exceptions;
@@ -16,6 +18,7 @@ namespace Hotline.Api.Controllers;
 
 public class IdentityController : BaseController
 {
+    private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
     private readonly IIdentityAppService _identityAppService;
     private readonly ISystemSettingCacheManager _systemSettingCacheManager;
     private readonly ISystemLogApplication _iSystemLogApplication;
@@ -57,8 +60,13 @@ Q9PP8NTEmKqdI3WVFYqW/OlOFC6sjiscTOOn9Tc5Mrcn8ocCjAPjkhkCCVRMiJnv
 jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
 -----END RSA PRIVATE KEY-----";
 
-    public IdentityController(IIdentityAppService identityAppService, ISystemSettingCacheManager systemSettingCacheManager, ISystemLogApplication iSystemLogApplication)
+    public IdentityController(
+        IOptionsSnapshot<AppConfiguration> appOptions,
+        IIdentityAppService identityAppService, 
+        ISystemSettingCacheManager systemSettingCacheManager, 
+        ISystemLogApplication iSystemLogApplication)
     {
+        _appOptions = appOptions;
         _identityAppService = identityAppService;
         _systemSettingCacheManager = systemSettingCacheManager;
         _iSystemLogApplication = iSystemLogApplication;
@@ -101,7 +109,14 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
         var LoginImage = _systemSettingCacheManager.GetSetting(SettingConstants.LoginImage).SettingValue;
         var IsLoginMessageCode = bool.Parse(_systemSettingCacheManager.GetSetting(SettingConstants.IsLoginMessageCode).SettingValue[0]);
 
-        return new LoginPageInfoDto() { SysName = SysName, LoginImage = LoginImage, IsLoginMessageCode = IsLoginMessageCode };
+        return new LoginPageInfoDto
+        {
+            SysName = SysName, 
+            LoginImage = LoginImage, 
+            IsLoginMessageCode = IsLoginMessageCode,
+            AppScope = _appOptions.Value.AppScope,
+            CallCenterType = _appOptions.Value.GetDefaultAppScopeConfiguration().CallCenterType
+        };
     }
 
     private LoginDto Decrypt(LoginDto dto)

+ 10 - 0
src/Hotline.Share/Dtos/Identity/LoginDto.cs

@@ -20,5 +20,15 @@ namespace Hotline.Share.Dtos.Identity
         public List<string> LoginImage { get; set; }
 
         public bool IsLoginMessageCode { get; set; }
+
+        /// <summary>
+        /// 应用范围
+        /// </summary>
+        public string AppScope { get; set; }
+
+        /// <summary>
+        /// 呼叫中心类型
+        /// </summary>
+        public string CallCenterType { get; set; }
     }
 }