fix: 接口调用错误
This commit is contained in:
parent
71461a04df
commit
fa0777b6ae
@ -121,7 +121,7 @@ const getRobotMsg = async () =>
|
|||||||
* @param chat_id
|
* @param chat_id
|
||||||
*/
|
*/
|
||||||
const sendCIReportByChatId = async (chat_id: string) => {
|
const sendCIReportByChatId = async (chat_id: string) => {
|
||||||
await service.egg.sendMessage.byChatId(chat_id, await getRobotMsg());
|
await service.sendMessage.byChatId(chat_id, await getRobotMsg());
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,10 +129,7 @@ const sendCIReportByChatId = async (chat_id: string) => {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const sendCIReportByCron = async () =>
|
const sendCIReportByCron = async () =>
|
||||||
await service.egg.sendMessage.byGroupId(
|
await service.sendMessage.byGroupId("52usf3w8l6z4vs1", await getRobotMsg());
|
||||||
"52usf3w8l6z4vs1",
|
|
||||||
await getRobotMsg()
|
|
||||||
);
|
|
||||||
|
|
||||||
const manageRobot = {
|
const manageRobot = {
|
||||||
sendCIReportByChatId,
|
sendCIReportByChatId,
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import egg from "./egg";
|
import sendMessage from "./sendMessage";
|
||||||
import gitlab from "./gitlab";
|
import gitlab from "./gitlab";
|
||||||
|
|
||||||
const service = {
|
const service = {
|
||||||
gitlab,
|
gitlab,
|
||||||
egg,
|
sendMessage,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default service;
|
export default service;
|
||||||
|
@ -3,7 +3,7 @@ import netTool from "./netTool";
|
|||||||
const sendMessage = async (body: any) => {
|
const sendMessage = async (body: any) => {
|
||||||
const URL = "https://egg.imoaix.cn/message";
|
const URL = "https://egg.imoaix.cn/message";
|
||||||
try {
|
try {
|
||||||
const res = await netTool.post(URL, JSON.stringify(body));
|
const res = await netTool.post(URL, body);
|
||||||
return res;
|
return res;
|
||||||
} catch {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
@ -27,8 +27,4 @@ sendMessage.byChatId = async (chat_id: string, content: string) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const egg = {
|
export default sendMessage;
|
||||||
sendMessage,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default egg;
|
|
Loading…
x
Reference in New Issue
Block a user