(self)
| 3342 | time.sleep(2) |
| 3343 | |
| 3344 | def getAuthToken_sec(self): |
| 3345 | if not getattr(self, 'sec_ticket1', None): |
| 3346 | self.log("安全管家 getAuthToken_sec 缺少 ticket1,跳过") |
| 3347 | return |
| 3348 | try: |
| 3349 | url = "https://uca.wo116114.com/api/v1/auth/ticket?product_line=uasp&entry_point=h5&entry_point_id=edop_unicom_3a6cc75a" |
| 3350 | headers = { |
| 3351 | "User-Agent": "ChinaUnicom4.x/12.3.1 (com.chinaunicom.mobilebusiness; build:77; iOS 16.6.0) Alamofire/4.7.3 unicom{version:iphone_c@12.0301}", |
| 3352 | "Content-Type": "application/json", |
| 3353 | "clientType": "uasp_unicom_applet" |
| 3354 | } |
| 3355 | data = { "productId": "", "type": 1, "ticket": self.sec_ticket1 } |
| 3356 | res = self.session.post(url, json=data, headers=headers).json() |
| 3357 | if res.get('data'): |
| 3358 | self.sec_token = res['data'].get('access_token') |
| 3359 | else: |
| 3360 | self.log(f"安全管家: getAuthToken_sec 失败 - {res}") |
| 3361 | except Exception as e: |
| 3362 | self.log(f"安全管家: getAuthToken_sec 异常: {e}") |
| 3363 | |
| 3364 | def getTicketForJF_sec(self): |
| 3365 | if not getattr(self, 'sec_token', None): |
no test coverage detected