mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-07 08:27:13 +08:00
refactor structure to monorepo
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
export function createTextMessage (text) {
|
||||
return {
|
||||
"dingtalkRequestBody": {
|
||||
"msgtype": "text",
|
||||
"text": {
|
||||
"content": `${text}`
|
||||
},
|
||||
},
|
||||
insertedTime: new Date(),
|
||||
}
|
||||
}
|
||||
|
||||
export async function requestDingtalkNotify (dingTalkAccessToken, body) {
|
||||
const url = new URL(`https://oapi.dingtalk.com/robot/send`)
|
||||
url.searchParams.append(
|
||||
'access_token',
|
||||
dingTalkAccessToken
|
||||
)
|
||||
|
||||
return await fetch(
|
||||
url,
|
||||
{
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user