update
This commit is contained in:
16
wxmsg/src/wx/send-user.ts
Normal file
16
wxmsg/src/wx/send-user.ts
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user