Ejemplo n.º 1
0
def jiemi(datas):
    URL = '/machine/decrypt'
    full_url = BaseConfig().app_url + URL
    headers = {'Content-Type': "application/json", 'Cache-Control': "no-cache"}
    data = datas
    jiemi = requests.request('post', url=full_url, headers=headers, data=data)
    return jiemi.text
Ejemplo n.º 2
0
 def tokens(self):
     self.token = BaseConfig().base_token
     headers = {
         'Content-Type': "application/x-www-form-urlencoded",
         'cache-control': "no-cache",
     }
     headers['lf-None-Matoh'] = self.token
     return headers
Ejemplo n.º 3
0
def tokensnew():
    token = BaseConfig().base_token
    headers = {
        'Content-Type': "application/json",
        'cache-control': "no-cache",
    }
    headers['lf-None-Matoh'] = token
    return headers
Ejemplo n.º 4
0
    def updata(self):
        #url拼接
        self.full_url = BaseConfig().base_url + self.updataUrl

        #发送post请求
        updatares = requests.request("POST",self.full_url,data=self.updatas,headers=self.tokens())
        if updatares.status_code ==200:
            return  updatares.text
        else:
            return {"errcode": 9001, "errmsg": str(updatares)}
Ejemplo n.º 5
0
    def post(self):
        #url拼接
        self.full_url = BaseConfig().base_url + self.Url

        #发送post请求
        res = requests.request("POST",self.full_url,data=self.payload,headers=self.tokens())
        if res.status_code ==200:
            return res.text
        else:
            return {"errcode": 9001, "errmsg": str(res)}
Ejemplo n.º 6
0
def checkjiami(datas):
    URL = '/machine/encrypt'
    full_url = BaseConfig().check_url + URL
    headers = {'Content-Type': "application/json", 'Cache-Control': "no-cache"}
    data = datas
    checkjiami = requests.request('post',
                                  url=full_url,
                                  headers=headers,
                                  data=datas)
    return checkjiami.text
Ejemplo n.º 7
0
    def post(self):
        #url拼接
        self.full_url = BaseConfig().app_url + self.Url

        #发送post请求
        res = requests.request("POST",
                               self.full_url,
                               data=self.payload,
                               headers=self.tokens())
        return res.text
Ejemplo n.º 8
0
def checkjiemi(datas):
    URL = '/machine/decrypt'
    full_url = BaseConfig().check_url + URL
    headers = {'Content-Type': "application/json",'Cache-Control': "no-cache"}
    data = datas
    checkjiemi = requests.request('post',url=full_url,headers=headers,data=data)
    return checkjiemi.text

# a = '6a54f7c88ed80836fcaba17d5eb4c79dd319c7a18157c7eb59d75e49eafda571b2836631799d7a1ee408b55f64d22de2'
# print jiemi(a)
Ejemplo n.º 9
0
def checkjiemi(datas):
    URL = '/machine/decrypt'
    full_url = BaseConfig().check_url + URL
    headers = {'Content-Type': "application/json", 'Cache-Control': "no-cache"}
    data = datas
    checkjiemi = requests.request('post',
                                  url=full_url,
                                  headers=headers,
                                  data=data)
    return checkjiemi.text


# a = '6a54f7c88ed80836fcaba17d5eb4c79dd319c7a18157c7eb59d75e49eafda571b2836631799d7a1ee408b55f64d22de2'
# print jiemi(a)

# a = '{"channelJson":[{"code":1,"volumeCount":11,"workStatus":0},{"code":2,"volumeCount":11,"workStatus":0},{"code":3,"volumeCount":11,"workStatus":0},{"code":4,"volumeCount":11,"workStatus":0},{"code":5,"volumeCount":11,"workStatus":0},{"code":6,"volumeCount":11,"workStatus":0},{"code":7,"volumeCount":11,"workStatus":0},{"code":8,"volumeCount":11,"workStatus":0},{"code":11,"volumeCount":11,"workStatus":0},{"code":12,"volumeCount":11,"workStatus":0},{"code":13,"volumeCount":11,"workStatus":0},{"code":14,"volumeCount":11,"workStatus":0},{"code":15,"volumeCount":11,"workStatus":0},{"code":16,"volumeCount":11,"workStatus":0},{"code":17,"volumeCount":11,"workStatus":0},{"code":18,"volumeCount":11,"workStatus":0},{"code":21,"volumeCount":11,"workStatus":0},{"code":23,"volumeCount":11,"workStatus":0},{"code":25,"volumeCount":11,"workStatus":0},{"code":27,"volumeCount":11,"workStatus":0},{"code":31,"volumeCount":11,"workStatus":0},{"code":32,"volumeCount":11,"workStatus":0},{"code":33,"volumeCount":11,"workStatus":0},{"code":34,"volumeCount":11,"workStatus":0},{"code":35,"volumeCount":11,"workStatus":0},{"code":36,"volumeCount":11,"workStatus":0},{"code":37,"volumeCount":11,"workStatus":0},{"code":38,"volumeCount":11,"workStatus":0},{"code":41,"volumeCount":11,"workStatus":0},{"code":42,"volumeCount":11,"workStatus":0},{"code":43,"volumeCount":11,"workStatus":0},{"code":44,"volumeCount":11,"workStatus":0},{"code":45,"volumeCount":11,"workStatus":0},{"code":46,"volumeCount":11,"workStatus":0},{"code":51,"volumeCount":11,"workStatus":0},{"code":52,"volumeCount":11,"workStatus":0},{"code":53,"volumeCount":11,"workStatus":0},{"code":54,"volumeCount":11,"workStatus":0},{"code":55,"volumeCount":11,"workStatus":0},{"code":56,"volumeCount":11,"workStatus":0}],"machineCode":"18865687","bluetoothAddress":""})'
# print jiami(a)
Ejemplo n.º 10
0
 def __init__(self):
     self.baseUrl = BaseConfig().base_url
     self.url = self.baseUrl + self.url
Ejemplo n.º 11
0
    # print rows_num

    for row in xrange(rows_num):
        first_id = select_sheet.cell(row, 0).value
        first_code = select_sheet.cell(row,1).value
        machineId.append(first_id)
        machineCode.append(first_code)

    return  json.dumps(dict(zip(machineCode, machineId)))



if __name__=="__main__":
    # URL信息
    # 安装升级
    Url = BaseConfig().base_url + "/machine/machine/installApp"
    # 更新机器app信息2,截图3
    Urljiepin = BaseConfig().base_url + "/machine/machine/updateInfo"
    # 切换app
    URLwang = BaseConfig().base_url + "/machine/machine/cutApp"
    # push消息
    URLpush =   "http://api.app.inno72.com/push/pushMsg"
    # 添加任务升级
    URLtask = 'http://api.erp.inno72.com/machine/task/add'
    # 清除所机
    Shipurl = 'http://api.monitor.inno72.com/sendMsgToClient/sendMsgStr'
    # 数据信息
    appname = ['com.inno72.zeusapp']
    appurl = ['http://inno72.oss.72solo.com/apk/prod/prod_zeus1.0.1.apk']
    appversion = ['2']
    appId = ['19']
Ejemplo n.º 12
0
 def __init__(self, url='/xxx/xxxx'):
     self.baseUrl = BaseConfig().base_url
     self.url = self.baseUrl + str(url).strip()