Client/AntDesignClient/Gardener.Client.AntDesignUi.Base/Shared/LoginLayout.razor.cs

(完整代码) 1KB

// -----------------------------------------------------------------------------
// 园丁,是个很简单的管理系统
//  gitee:https://gitee.com/hgflydream/Gardener 
//  issues:https://gitee.com/hgflydream/Gardener/issues 
// -----------------------------------------------------------------------------

using AntDesign;
using Gardener.Client.Base;
using Gardener.Client.Base.Services;
using Microsoft.AspNetCore.Components;

namespace Gardener.Client.AntDesignUi.Base.Shared
{
    public partial class LoginLayout
    {
        private string[] _locales=null!;

        private SystemConfig systemConfig = null!;
        /// <summary>
        /// 系统配置服务
        /// </summary>
        [Inject]
        private ISystemConfigService SystemConfigService { get; set; } = null!;
        [Inject]
        private IJsTool JsTool { get; set; } = null!;
        [Inject]
        private IClientCultureService clientCultureService { get; set; } = null!;
        [Inject]
        public NavigationManager Navigation { get; set; } = null!;
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected async override Task OnInitializedAsync()
        {
            _locales = clientCultureService.GetSupportedCultures();
            systemConfig = SystemConfigService.GetSystemConfig();
            await JsTool.Document.SetTitle(systemConfig.SystemName);
            await base.OnInitializedAsync();
        }
        /// <summary>
        /// HandleSelectLang
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public async Task HandleSelectLang(MenuItem item)
        {
            string name = item.Key;
            if (await clientCultureService.SetCulture(name))
            {
                Navigation.NavigateTo(Navigation.Uri, forceLoad: true);
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。