This commit is contained in:
lzh
2025-07-14 13:38:45 +08:00
parent b4c7ab9f2c
commit 5356eb4199
2 changed files with 4 additions and 8 deletions

View File

@@ -57,10 +57,8 @@ func (r *Response) SetCode(code int) *Response {
func (r *Response) SetMessage(msg any) *Response {
if str, ok := msg.(string); ok {
r.Msg = str
} else {
if err, ok := msg.(error); ok {
} else if err, ok := msg.(error); ok {
r.Msg = err.Error()
}
}
return r
}

View File

@@ -121,11 +121,9 @@ func (t *TaskJob) InitCronHandle() error {
func (t *TaskJob) EditStatus(status bool) error {
if t.Cron != nil && !status {
t.Cron.Stop()
} else {
if err := t.InitCronHandle(); err != nil {
} else if err := t.InitCronHandle(); err != nil {
return err
}
}
t.TaskConfig.Enable = status
return nil
}