Files
2023-08-12 15:56:22 +08:00

26 lines
503 B
TypeScript

import type { PlasmoMessaging } from "@plasmohq/messaging"
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const url = "http://192.168.31.245:8080?a=1"
console.log('getmessage')
const customHeaders = {
"Content-Type": "application/json"
}
const data = {
id: req.body.id
}
const message = await fetch(url, {
method: "POST",
headers: customHeaders,
body: JSON.stringify(data)
})
res.send({
message:'1112'
})
}
export default handler