构造 admin 请求头
(self)
| 278 | return None, False |
| 279 | |
| 280 | def _admin_headers(self) -> Dict[str, str]: |
| 281 | """构造 admin 请求头""" |
| 282 | headers = { |
| 283 | "x-admin-auth": self.config["admin_password"], |
| 284 | "Content-Type": "application/json", |
| 285 | "Accept": "application/json", |
| 286 | } |
| 287 | custom_auth = (self.config.get("custom_auth") or "").strip() |
| 288 | if custom_auth: |
| 289 | headers["x-custom-auth"] = custom_auth |
| 290 | return headers |
| 291 | |
| 292 | def _extract_mails_from_response(self, response: Any) -> List[Dict[str, Any]]: |
| 293 | """ |