This commit is contained in:
2025-11-30 04:48:09 +08:00
parent 53df135696
commit b7f1095e4a
14 changed files with 552 additions and 21 deletions

16
wxmsg/src/wx/send-user.ts Normal file
View File

@@ -0,0 +1,16 @@
export const sendUser = async (accessToken: string) => {
const data = {
touser: 'omcvy7AHC6bAA0QM4x9_bE0fGD1g',
msgtype: 'text',
text: {
content: 'Hello World',
},
};
const url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN';
const link = url.replace('ACCESS_TOKEN', accessToken);
const res = await fetch(link, {
method: 'POST',
body: JSON.stringify(data),
}).then((res) => res.json());
console.log('res', res);
};