| | |
| | | |
| | | private JsonPageResult Login(PageContext<SysUser> context) |
| | | { |
| | | string a = context.Session["Code"] as string; |
| | | string string1 = context.GetString("code"); |
| | | string string2 = context.GetString("account"); |
| | | string string3 = context.GetString("password"); |
| | | string sessionCode = context.Session["Code"] as string; |
| | | string code = context.GetString("code"); |
| | | string account = context.GetString("account"); |
| | | string password = context.GetString("password"); |
| | | string str = "登录成功!"; |
| | | int num = 2; |
| | | if (string.IsNullOrEmpty(string2)) |
| | | if (string.IsNullOrEmpty(account)) |
| | | return new JsonPageResult(false, (object) new |
| | | { |
| | | Content = "请输入账号后再登录!", |
| | | Tstatus = num |
| | | }); |
| | | if (string.IsNullOrEmpty(string3)) |
| | | if (string.IsNullOrEmpty(password)) |
| | | return new JsonPageResult(false, (object) new |
| | | { |
| | | Content = "请输入密码后再登录!", |
| | | Tstatus = num |
| | | }); |
| | | if (!string.Equals(a, string1, StringComparison.OrdinalIgnoreCase)) |
| | | if (!string.Equals(sessionCode, code, StringComparison.OrdinalIgnoreCase)) |
| | | return new JsonPageResult(false, (object) new |
| | | { |
| | | Content = "验证码错误,请重新输入!", |
| | |
| | | |
| | | try |
| | | { |
| | | user = this.dao.GetUser(string2); |
| | | string3 += user.Salt; |
| | | if (!this.dao.CheckLogin(string2, string3, user)) |
| | | user = this.dao.GetUser(account); |
| | | password += user.Salt; |
| | | if (!this.dao.CheckLogin(account, password, user)) |
| | | return new JsonPageResult(false, (object)new |
| | | { |
| | | Content = "用户名或密码错误!", |