This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| async fetch(request, env, ctx) { | |
| const url = new URL(request.url); | |
| // 处理 API 请求:支持 POST (/api/add-ssl) 和 GET (/?...) | |
| if ( | |
| (url.pathname === '/api/add-ssl' && request.method === 'POST') || | |
| (url.pathname === '/' && request.method === 'GET' && url.searchParams.has('zoneId')) | |
| ) { | |
| return handleApiRequest(request, url.searchParams); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| async fetch(request, env, ctx) { | |
| const url = new URL(request.url); | |
| // 处理 API 请求:支持 POST (/api/add-ssl) 和 GET (/?...) | |
| if ( | |
| (url.pathname === '/api/add-ssl' && request.method === 'POST') || | |
| (url.pathname === '/' && request.method === 'GET' && url.searchParams.has('zoneId')) | |
| ) { | |
| return handleApiRequest(request, url.searchParams); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import time | |
| import re | |
| import os | |
| # 从环境变量中获取 Cookie | |
| COOKIES = os.environ.get('BAIDU_COOKIE', '') | |
| HEADERS = { | |
| 'Connection': 'keep-alive', |