예제 #1
0
 //[ValidateAntiForgeryToken]
 public ActionResult Login(string Account, string Password, string VerifyCode)
 {
     try
     {
         if (VerifyCodeHelper.Check(VerifyCode))
         {
             T_User t_User = userBLL.CheckLogin(Account, Password);
             if (t_User != null)
             {
                 userBLL.AddProvider(t_User);
                 LogApp.Write(LogApp.Result.Success);
                 return(Content(new JsonMessage {
                     state = "success", msg = "登录成功,正在跳转中...", data = new { url = "/Index/Index" }
                 }.ToJson()));
             }
             else
             {
                 throw new Exception("登录失败");
             }
         }
         else
         {
             throw new Exception("验证码错误");
         }
     }
     catch (Exception ex)
     {
         return(Content(new JsonMessage {
             state = "error", msg = ex.Message
         }.ToJson()));
     }
 }
예제 #2
0
 public ActionResult SubmitFormUserInfo(T_User t_User, HttpPostedFileBase F_Head_Icon_File)
 {
     if (F_Head_Icon_File != null)
     {
         t_User.F_Head_Icon = UploadHelper.ImageSaveSquare(F_Head_Icon_File, "UserHeadIcon", 200);
     }
     t_User.F_Id          = ManageProvider.Provider.Current().User.F_Id;
     t_User.F_Online_Mark = ManageProvider.Provider.Current().User.F_Online_Mark;
     t_User.F_System_Mark = ManageProvider.Provider.Current().User.F_System_Mark;
     t_User.F_Enable_Mark = ManageProvider.Provider.Current().User.F_Enable_Mark;
     t_User.F_Delete_Mark = ManageProvider.Provider.Current().User.F_Delete_Mark;
     userBLL.SubmitForm(t_User);
     userBLL.AddProvider(t_User);
     return(Content(new JsonMessage {
         state = "success", msg = "操作成功"
     }.ToJson()));
 }