Fixed some Login method bug cause by state code.And wrapped Staff to a class.