mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-10-04 23:52:53 +08:00
update
This commit is contained in:
@@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -46,9 +47,15 @@ func (w *WsConnetInstance) Cancel() {
|
||||
var upgrader = websocket.Upgrader{
|
||||
ReadBufferSize: 1024,
|
||||
WriteBufferSize: 1024,
|
||||
CheckOrigin: func(r *http.Request) bool {
|
||||
return true // 允许所有跨域请求
|
||||
},
|
||||
}
|
||||
|
||||
func (w *wsApi) WebsocketHandle(ctx *gin.Context, req model.WebsocketHandleReq) (err error) {
|
||||
if !hasOprPermission(ctx, req.Uuid, eum.OperationTerminal) {
|
||||
return errors.New("not permission")
|
||||
}
|
||||
reqUser := getUserName(ctx)
|
||||
proc, err := logic.ProcessCtlLogic.GetProcess(req.Uuid)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user