zimin9 / WoZaiXiaoYuanPuncher

我在校园日检日报自动打卡程序。
Apache License 2.0
38 stars 19 forks source link

打卡返回{'code': 599, 'message': '其他系统异常'} #20

Open xbaia opened 1 year ago

xbaia commented 1 year ago

抓包的headers: POST https://gw.wozaixiaoyuan.com/health/mobile/health/save?batch=1700001 HTTP/1.1 Host: gw.wozaixiaoyuan.com Connection: keep-alive Content-Length: 227 Accept: application/json, text/plain, / JWSESSION: d45df9af5841460981745c98dd440441 User-Agent: Mozilla/5.0 (Linux; Android 10; SCMR-W09 Build/HUAWEISCMR-W09; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/4343 MMWEBSDK/20221012 Mobile Safari/537.36 MMWEBID/8277 MicroMessenger/8.0.30.2260(0x28001E55) WeChat/arm64 Weixin Android Tablet NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wxce6d08f781975d91 Content-Type: application/json;charset=UTF-8 Origin: https://gw.wozaixiaoyuan.com X-Requested-With: com.tencent.mm Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://gw.wozaixiaoyuan.com/h5/mobile/health/0.3.7/health/detail?id=1700001 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7 Cookie: JWSESSION=d45df9af5841460981745c98dd440441; JWSESSION=d45df9af5841460981745c98dd440441

headers = { "Host": "gw.wozaixiaoyuan.com", "Connection": "keep-alive",

"Content-Length": "227",

        "Accept": "application/json, text/plain, */*",
        "JWSESSION": self.cookies['JWSESSION'],
        "User-Agent": "Mozilla/5.0 (Linux; Android 10; SCMR-W09 Build/HUAWEISCMR-W09; wv) AppleWebKit/537.36 ("
                      "KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/4343 MMWEBSDK/20221012 Mobile "
                      "Safari/537.36 MMWEBID/8277 MicroMessenger/8.0.30.2260(0x28001E55) WeChat/arm64 Weixin "
                      "Android Tablet NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wxce6d08f781975d91",
        "Content-Type": "application / json;charset=UTF-8",
        "Origin": "https://gw.wozaixiaoyuan.com",
        "X-Requested-With": "com.tencent.mm",
        "Sec-Fetch-Site": "same-origin",
        "Sec-Fetch-Mode": "cors",
        "Sec-Fetch-Dest": "empty",
        "Referer": "https://gw.wozaixiaoyuan.com/h5/mobile/health/0.3.7/health/detail?id="+ID,
        "Accept-Encoding": "gzip, deflate",
        "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
    }
xbaia commented 1 year ago

问题解决:headers的问题,修改后的headsers: headers = { 'Host': 'gw.wozaixiaoyuan.com', 'Connection': 'keep-alive', 'Accept': 'application/json, text/plain, /', 'JWSESSION': self.cookies['JWSESSION'], 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; SCMR-W09 Build/HUAWEISCMR-W09; wv) AppleWebKit/537.36 (' 'KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/4343 MMWEBSDK/20221012 Mobile ' 'Safari/537.36 MMWEBID/8277 MicroMessenger/8.0.30.2260(0x28001E55) WeChat/arm64 Weixin ' 'Android Tablet NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wxce6d08f781975d91', 'Content-Type': 'application/json;charset=UTF-8', 'Origin': 'https://gw.wozaixiaoyuan.com', 'X-Requested-With': 'com.tencent.mm', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-Mode': 'cors', 'Sec-Fetch-Dest': 'empty', 'Referer': 'https://gw.wozaixiaoyuan.com/h5/mobile/health/0.3.7/health/detail?id=' + ID, 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7', 'Cookie': 'JWSESSION=' + self.cookies['JWSESSION'] + '; ' + 'JWSESSION=' + self.cookies['JWSESSION'] }