feat: 新增Telegram通知支持,新增手动发送日报功能
1. 新增Telegram机器人通知配置项和实现逻辑 2. 重构通知发送逻辑为统一的sendAllNotifications方法 3. 调整日报定时任务时间为23:30,优化日报内容 4. 后台页面新增手动发送日报按钮和相关接口 5. 优化通知提示文案,兼容多通知渠道
This commit is contained in:
@@ -86,7 +86,21 @@ export default function Dashboard({ onLogout }) {
|
||||
const res = await fetch('/api/test-notify');
|
||||
const data = await res.json();
|
||||
if (data.success) {
|
||||
message.success('测试消息已发送,请查看企业微信');
|
||||
message.success('测试消息已发送,请检查通知渠道');
|
||||
} else {
|
||||
message.error('发送失败');
|
||||
}
|
||||
} catch {
|
||||
message.error('发送失败');
|
||||
}
|
||||
};
|
||||
|
||||
const handleSendReport = async () => {
|
||||
try {
|
||||
const res = await fetch('/api/send-report');
|
||||
const data = await res.json();
|
||||
if (data.success) {
|
||||
message.success('日报已发送');
|
||||
} else {
|
||||
message.error('发送失败');
|
||||
}
|
||||
@@ -333,6 +347,18 @@ body { margin: 0; }
|
||||
>
|
||||
测试通知
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleSendReport}
|
||||
size="small"
|
||||
style={{
|
||||
border: '1px solid var(--border-light)',
|
||||
borderRadius: 20,
|
||||
color: 'var(--text-secondary)',
|
||||
fontSize: 13,
|
||||
}}
|
||||
>
|
||||
发送日报
|
||||
</Button>
|
||||
<Button
|
||||
icon={<LogoutOutlined />}
|
||||
onClick={handleLogout}
|
||||
|
||||
Reference in New Issue
Block a user