ErrorDesc = [ (1002, "登录失败,请提供正确的用户名和密码"), (2002, "请使用正确的方法获取数据"), ] def getMessage(code): return ErrorDesc[code]