marge: 合并代码
This commit is contained in:
@@ -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 ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user