v1.2.82:修复新套请假审批人查询失败——时间格式统一裁秒
ci/woodpecker/tag/build Pipeline was successful

新套 getApproveFlowList 按 "yyyy-MM-dd HH:mm" 严格解析(如 hbgyzy 病假类型 7151
报 unparsed text found at index 16),前端补秒的 19 字符时间导致接口报错,
前端静默降级后误显示"该校该请假类型未配置审批人"。在 FetchLeaveNewApproveFlow
服务层统一裁秒,覆盖前端预取与提交执行两条调用路径。
This commit is contained in:
becomer
2026-09-23 00:14:53 +08:00
parent 21b37c6ad8
commit 518f3506df
+13 -2
View File
@@ -338,13 +338,24 @@ type LeaveNewFlow struct {
FlowData map[string]interface{} `json:"flowData"`
}
// leaveNewTrimSeconds "yyyy-MM-dd HH:mm:ss" → "yyyy-MM-dd HH:mm"(新套时间格式)。
// 新套接口(Java 端)按 "yyyy-MM-dd HH:mm" 严格解析,带秒会报
// "unparsed text found at index 16"(如 hbgyzy 病假类型 7151),故统一裁秒。
func leaveNewTrimSeconds(t string) string {
t = strings.TrimSpace(t)
if len(t) == 19 && t[16] == ':' && t[13] == ':' {
return t[:16]
}
return t
}
// FetchLeaveNewApproveFlow 获取审批人列表与审批流数据(选类型+起止时间后调用)
func FetchLeaveNewApproveFlow(cookieMap map[string]string, host string, typeWid int, startTime, endTime, leaveID string) (*LeaveNewFlow, error) {
payload := map[string]interface{}{
"leaveId": leaveID,
"typeWid": typeWid,
"startTime": startTime,
"endTime": endTime,
"startTime": leaveNewTrimSeconds(startTime),
"endTime": leaveNewTrimSeconds(endTime),
}
body, err := leavePost(cookieMap, host+leaveNewAPIBase+"/stu/stuLeaveOperate/getApproveFlowList", payload, "")
if err != nil {