public User Login(string code, string password, string deviceType) { var user = UserHelper.Validate(code, password); if (user != null) { AddToCache(user, deviceType); return(user); } else { throw new Exception("账号或者密码错误!"); } }