| 4 | const appId = process.env.PLASMO_PUBLIC_COZE_APPID |
| 5 | |
| 6 | export async function getSummary(url: string) { |
| 7 | const data = { |
| 8 | workflow_id: workflowId, |
| 9 | app_id: appId, |
| 10 | parameters: { |
| 11 | url: url |
| 12 | } |
| 13 | } |
| 14 | try { |
| 15 | const res = await fetch(cozeUrl, { |
| 16 | method: "POST", |
| 17 | headers: { |
| 18 | Authorization: `Bearer ${token}`, |
| 19 | "Content-Type": "application/json" |
| 20 | }, |
| 21 | body: JSON.stringify(data) |
| 22 | }).then((response) => response.json()) // 解析返回的 JSON 数据 |
| 23 | return res |
| 24 | } catch (error) { |
| 25 | console.error("Error:", error) |
| 26 | } |
| 27 | } |