public ResponseData Excute(LoginInfo data) { int userId; int userType; string passportId; if (!string.IsNullOrEmpty(data.RetailUser) && !string.IsNullOrEmpty(data.RetailToken)) { ILogin login = LoginProxy.GetLogin(data.RetailID, data); login.Password = DecodePassword(login.Password); var watch = RunTimeWatch.StartNew("Request login server"); try { if (login.CheckLogin()) { watch.Check("GetResponse"); userId = int.Parse(login.UserID); passportId = login.PassportID; userType = login.UserType; } else { //DoLoginFail(); throw new HandlerException(StateCode.Error, StateDescription.PassworkError); } } finally { watch.Flush(true, 100); } } else { if (string.IsNullOrEmpty(data.Pwd) || data.Pwd.Length < 5) { throw new HandlerException(StateCode.Error, StateDescription.PassworkLengthError); } data.Pwd = DecodePassword(data.Pwd); //快速登录 RegType regType; userId = SnsManager.LoginByDevice(data.Pid, data.Pwd, data.DeviceID, out regType, data.IsCustom); if (userId <= 0) { throw new HandlerException(StateCode.PassworkError, StateDescription.PassworkError); } passportId = data.Pid; userType = (int)regType; } return(AuthorizeLogin(userId, passportId, userType)); }
public ResponseData Excute(LoginInfo data) { if (string.IsNullOrEmpty(data.Pwd) || data.Pwd.Length < 5) { throw new HandlerException(StateCode.Error, StateDescription.PassworkLengthError); } if (data.Pwd.Length > 32) { data.Pwd = DecodePassword(data.Pwd); } //快速登录 var userId = SnsManager.LoginByDevice(data.Pid, data.Pwd, data.IMEI); if (userId <= 0) { throw new HandlerException(StateCode.PassworkError, StateDescription.PassworkError); } return(AuthorizeLogin(userId, data.Pid)); }