feat: 添加定时系统

- 实现定时任务
This commit is contained in:
2026-03-26 22:59:58 +08:00
parent 858c29a799
commit b0db64bd7b
8 changed files with 126 additions and 9 deletions

View File

@@ -28,11 +28,16 @@ func (h *WKHandler) Login(ctx *gin.Context) {
return
}
log.Debug("请求数据", zap.Any("req", req))
var cookies = []*http.Cookie{
{
Name: "token",
Value: req.Token,
Path: "/"},
var cookies []*http.Cookie
if req.Token != "" {
cookies = []*http.Cookie{
{
Name: "token",
Value: req.Token,
Path: "/"},
}
} else {
cookies = []*http.Cookie{}
}
wk := ckwk.NewWK(req.Username, req.Password, req.Host, cookies)
if wk == nil {
@@ -171,3 +176,16 @@ func (h *WKHandler) AllRecord(ctx *gin.Context) {
"page_info": pageInfo,
}))
}
func (h *WKHandler) Host(ctx *gin.Context) {
ctx.JSON(200, dto.Success(map[string]any{
"list": []map[string]any{
{"host": "cqcst.leykeji.com", "name": "劳动课程测评考试平台"},
{"host": "cqcst.zjxkeji.com", "name": "公益课程平台"},
{"host": "cqcst.suwankj.com", "name": "在线课程测评考试平台"},
{"host": "cqcst.yuruixxkj.com", "name": "在线测评考试平台"},
// {"host": "cqcst.yuncanjykeji.com", "name": "劳动课程测评考试平台"},
// {"host": "cqcst.yuruixxkj.com", "name": "公益课程平台"},
},
}))
}