This action will force synchronization from dotNET China/OpenAuth.Net, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
// ***********************************************************************// Assembly : OpenAuth.Mvc// Author : yubaolee// Created : 07-11-2016//// Last Modified By : yubaolee// Last Modified On : 07-19-2016// Contact : www.cnblogs.com/yubaolee// File: BaseController.cs// ***********************************************************************using OpenAuth.Mvc.Models;using System;using System.Collections.Generic;using System.Configuration;using System.Linq;using System.Reflection;using System.Web;using System.Web.Mvc;using Infrastructure;using OpenAuth.App.SSO;using OpenAuth.App.ViewModel;namespace OpenAuth.Mvc.Controllers{/// <summary>/// 基础控制器/// <para>用于控制登录用户是否有权限访问指定的Action</para>/// <para>李玉宝新增于2016年07月19日 11:12:09</para>/// </summary>public class BaseController : SSOController{protected Response Result = new Response();protected ModuleView CurrentModule;protected string Controllername; //当前控制器小写名称protected string Actionname; //当前Action小写名称protected override void OnActionExecuting(ActionExecutingContext filterContext){base.OnActionExecuting(filterContext);if (!AuthUtil.CheckLogin()) return;Controllername = Request.RequestContext.RouteData.Values["controller"].ToString().ToLower();Actionname = filterContext.ActionDescriptor.ActionName.ToLower();var function = this.GetType().GetMethods().FirstOrDefault(u => u.Name.ToLower() == Actionname);if (function == null)throw new Exception("未能找到Action");var authorize = function.GetCustomAttribute(typeof(AuthenticateAttribute));CurrentModule = AuthUtil.GetCurrentUser().Modules.FirstOrDefault(u => u.Url.ToLower().Contains(Controllername));//当前登录用户没有Action记录&&Action有authenticate标识if (authorize != null && CurrentModule == null){filterContext.Result = new RedirectResult("/Login/Index");return;}var version = ConfigurationManager.AppSettings["version"];if (version == "demo" && Request.HttpMethod == "POST"){throw new HttpException(400, "演示版本,不能进行该操作,当前模块:" + Controllername + "/" + Actionname);}}}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。