MCPcopy
hub / github.com/smallfawn/QLScriptPublic / onLine

Method onLine

daily/chinaUnicom.py:629–670  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

627 self.log(f"queryRemain 异常: {str(e)}")
628
629 def onLine(self):
630 if not self.token_online:
631 self.log("❌ 缺少 token_online,无法执行 onLine")
632 return False
633 try:
634 url = "https://m.client.10010.com/mobileService/onLine.htm"
635 data = {
636 'isFirstInstall': '1',
637 'netWay': 'Wifi',
638 'version': 'android@11.0000',
639 'token_online': self.token_online,
640 'provinceChanel': 'general',
641 'deviceModel': 'ALN-AL10',
642 'step': 'dingshi',
643 'androidId': '291a7deb1d716b5a',
644 'reqtime': int(time.time() * 1000)
645 }
646 if self.appId:
647 data['appId'] = self.appId
648 res = self.request('post', url, data=data)
649 if not res: return False
650 result = res.json()
651 code = result.get('code')
652 if code == '0' or code == 0:
653 self.valid = True
654 desmobile = result.get('desmobile', '')
655 if len(desmobile) == 11 and desmobile.isdigit():
656 self.account_mobile = desmobile
657 self.mobile = desmobile
658 elif desmobile.startswith("enc_"):
659 if not self.account_mobile:
660 self.log("⚠️ 注意: 服务端返回了加密手机号且未配置本地手机号")
661 self.log("登录成功")
662 self.city_info = result.get('list', [])
663 self.ecs_token = result.get('ecs_token')
664 return True
665 else:
666 self.log(f"登录失败[{code}]: {result.get('msg')}")
667 return False
668 except Exception as e:
669 self.log(f"onLine 异常: {str(e)}")
670 return False
671
672 def gettaskip(self):
673 orderId = self.random_string(32).upper()

Callers 3

queryRemainMethod · 0.95
mainFunction · 0.95
run_grab_taskFunction · 0.80

Calls 4

logMethod · 0.95
requestMethod · 0.95
timeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected