Example #1
0
 public ActionResult Redirect(string url, ActionDescriptor action, AjaxStatu statu)
 {
     //判断是否Ajax请求
     if (action.IsDefined(typeof(AjaxRequestAttribute), false) ||
         action.ControllerDescriptor.IsDefined(typeof(AjaxRequestAttribute), false))
     {
         //判断是否有权限
         if (statu == AjaxStatu.nopermission)
         {
             return(PackagingAjaxmsg(new AjaxMsgModel(statu, string.Format("你没有操作【{0}】的权限!", action.Description()), null, "")));
         }
         return(PackagingAjaxmsg(new AjaxMsgModel(statu, "请先登录!", null, url)));
     }
     return(new RedirectResult(url));
 }