1
0

marge: 合并代码

This commit is contained in:
TsMask
2023-11-13 18:28:13 +08:00
parent 6caf373ab5
commit 21a5e210eb
77 changed files with 1001 additions and 664 deletions

View File

@@ -3,7 +3,7 @@ package session
import (
"crypto/rand"
"encoding/base64"
"errors"
"fmt"
"io"
"net/http"
"strconv"
@@ -89,7 +89,7 @@ func (smgr *SessManager) SetSessionValue(token string, key interface{}, value in
session.values[key] = value
return nil
}
return errors.New("invalid session ID")
return fmt.Errorf("invalid session ID")
}
// GetSessionValue get value fo session
@@ -101,7 +101,7 @@ func (smgr *SessManager) GetSessionValue(token string, key interface{}) (interfa
return val, nil
}
}
return nil, errors.New("invalid session ID")
return nil, fmt.Errorf("invalid session ID")
}
func (smgr *SessManager) GetTokenFromHttpRequest(r *http.Request) string {
@@ -111,7 +111,6 @@ func (smgr *SessManager) GetTokenFromHttpRequest(r *http.Request) string {
return v[0]
}
}
return ""
}