feat: add check

This commit is contained in:
weloe
2023-05-09 18:38:04 +08:00
parent f45277b4d5
commit c0542eb26e

View File

@@ -164,6 +164,9 @@ func (e *Enforcer) Login(id string, ctx ctx.Context) (string, error) {
// LoginByModel login by id and loginModel, return tokenValue and error
func (e *Enforcer) LoginByModel(id string, loginModel *model.Login, ctx ctx.Context) (string, error) {
if loginModel == nil {
return "", errors.New("arg loginModel can not be nil")
}
var err error
var session *model.Session
var tokenValue string