Ejemplo n.º 1
0
        /// <summary>
        /// 默认显示页面
        /// </summary>
        /// <returns></returns>
        public async Task <IActionResult> Home()
        {
            var userId = HttpContext.User.FindFirst(u => u.Type == ClaimTypes.NameIdentifier).Value;
            var user   = await _usersProvider.GetUserInfo(Convert.ToInt32(userId));

            var log = await _loginLogProvider.GetLastLoginLog(Convert.ToInt32(userId));

            var info = new UserInfoViewModel
            {
                LoginName = user.LoginName,
                EMP_EMAIL = user.EMP_EMAIL
            };

            return(View(info));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 默认显示页面
        /// </summary>
        /// <returns></returns>
        public async Task <IActionResult> Home()
        {
            var userId = HttpContext.User.FindFirst(u => u.Type == ClaimTypes.NameIdentifier).Value;
            var user   = await _usersProvider.GetUserInfo(Convert.ToInt32(userId));

            var log = await _loginLogProvider.GetLastLoginLog(Convert.ToInt32(userId));

            var info = new UserInfoViewModel
            {
                UserName      = user.UserName,
                Email         = user.Email,
                RegisterTime  = user.RegisterTime,
                LastLoginTime = log.LoginTime,
                LastLoginIP   = log.LoginIp
            };

            return(View(info));
        }