OL.FrameCore.WebUI/Controllers/HomeController.cs

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OL.FrameCore.Application;
using OL.FrameCore.Application.Article;
using OL.FrameCore.Application.Home;
using OL.FrameCore.Application.Module;
using OL.FrameCore.Application.Module.Dto;
using OL.FrameCore.Application.User;
using OL.FrameCore.Application.User.Dto;
using OL.FrameCore.Domain.Enum;
using OL.FrameCore.Infrastructure.Cache;
using OL.FrameCore.Infrastructure.Security;
using OL.FrameCore.Infrastructure.Utility;
using OL.FrameCore.WebUI.Models;
using OL.FrameCore.WebUI.ViewModels;

namespace OL.FrameCore.WebUI.Controllers
{
    public class HomeController : ControllerBase
    {
        IHomeService _homeService;
        IUserService _userService;
        IModuleService _moduleService;
        IArticleService _articleService;
        private readonly IHttpContextAccessor _httpContextAccessor;

        public HomeController(IHomeService homeService, IUserService userService, IModuleService moduleService, IArticleService articleService, IHttpContextAccessor httpContextAccessor)
        {
            _homeService = homeService;
            _userService = userService;
            _moduleService = moduleService;
            _articleService = articleService;
            _httpContextAccessor = httpContextAccessor;
        }

        public IActionResult Index()
        {

            if (this.HttpContext.User == null)
            {
                return Redirect("/home/login");
            }
            else
            {
                return Redirect("/home/overview");
            }
        }

        //public IActionResult Header2()
        //{
        //    return View();
后面还有 243 行代码,解锁后查看完整代码

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

AI 解读

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

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