You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
501 B

package ws
import (
"LAPP_LF_MOM_BACKEND/global"
"LAPP_LF_MOM_BACKEND/messaging"
baseModel "LAPP_LF_MOM_BACKEND/models/base"
"errors"
"github.com/kataras/neffos"
)
func init() {
global.WebsocketContext = messaging.Register(baseModel.NAMESPACE_EODS, neffos.Events {})
global.WebsocketContext.SetAuthenticator(func(headers map[string]string) (string, error) {
stn, ok := headers["STN"]
if !ok || stn == "" {
return "", errors.New("未获取到工位信息")
}
return stn, nil
})
}