fix: publickey

This commit is contained in:
ttk
2024-09-02 18:51:26 +08:00
parent 5caf481b68
commit c09565d673
11 changed files with 1038 additions and 54 deletions

View File

@@ -27,7 +27,7 @@ func (c *Controller) PostConfig(ctx *gin.Context) {
}
cfg := &model.Config{}
if err := ctx.BindJSON(cfg); err != nil {
if err := ctx.ShouldBindBodyWithJSON(cfg); err != nil {
ctx.AbortWithError(http.StatusBadRequest, &ApiError{Code: ErrInvalidArgument, Data: map[string]any{"err": err}})
return
}

View File

@@ -101,6 +101,8 @@ func HandleSsh(sess *gsession.Session) (err error) {
}
}()
chs := sess.Chans
sess.IdleTimout = idleTime()
sess.IdleTk = time.NewTicker(sess.IdleTimout)
tk, tk1s, tk1m := time.NewTicker(time.Millisecond*100), time.NewTicker(time.Second), time.NewTicker(time.Minute)
sess.G.Go(func() error {
return read(sess)