class Config: # 生产环境配置 PROD = { 'url' : "http://172.19.152.231/open/api/operate/upload", 'channel': "64", 'classIndex': "68", 'nvr': "172.19.152.231" } # 测试环境配置 TEST = { 'url' : "http://36.7.84.146:28801/open/api/operate/upload", 'channel': "251", 'classIndex': "101", 'nvr': "172.16.20.251" } @staticmethod def get(environment="test"): # 根据环境选择配置,默认选择测试环境 return Config.TEST if environment == "test" else Config.PROD