Exemplo n.º 1
0
        //登录方法
        public ActionResult LoginFunction(Base_User u)
        {
            ErrorResult err = new ErrorResult();

            try
            {
                string    pwd   = Util.Extention.ToMD5String(u.Password);
                Base_User findu = userinfo.GetList().Where(find => find.UserName == u.UserName && find.Password == pwd).FirstOrDefault();
                if (findu != null)
                {
                    SessionHelper.Session["UserId"] = findu.UserId;
                    err.Success = true;
                    err.Msg     = "登陆成功!";
                    err.Data    = "/Base_SysManage/Base_SysMenu/Index";
                    return(Json(err, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    err.Msg = "用户名或密码错误";
                }
            }
            catch (Exception ex)
            {
                BusHelper.WriteSysLog(ex.Message, EnumType.LogType.系统异常);
            }
            return(Json(err, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
 /// <summary>
 /// 写入日志
 /// </summary>
 /// <param name="logContent">日志内容</param>
 /// <param name="logType">日志类型</param>
 public static void WriteSysLog(string logContent, EnumType.LogType logType)
 {
     BusHelper.WriteSysLog(logContent, logType);
 }
Exemplo n.º 3
0
 public void LogTest()
 {
     LogHelper.WriteLog_LocalTxt("测试日志");
     BusHelper.WriteSysLog("测试日志", EnumType.LogType.系统异常);
 }