mirror of
https://github.com/astaxie/beego.git
synced 2025-06-12 14:10:39 +00:00
Add interface change in pkg folder
This commit is contained in:
@ -68,10 +68,10 @@ func (p *Provider) SessionRead(sid string) (session.Store, error) {
|
||||
}
|
||||
|
||||
// SessionExist judged whether sid is exist in session
|
||||
func (p *Provider) SessionExist(sid string) bool {
|
||||
func (p *Provider) SessionExist(sid string) (bool, error) {
|
||||
if p.client == nil {
|
||||
if err := p.connectInit(); err != nil {
|
||||
panic(err)
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
value, err := p.client.Get(sid)
|
||||
@ -79,9 +79,9 @@ func (p *Provider) SessionExist(sid string) bool {
|
||||
panic(err)
|
||||
}
|
||||
if value == nil || len(value.(string)) == 0 {
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
return true
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// SessionRegenerate regenerate session with new sid and delete oldsid
|
||||
|
Reference in New Issue
Block a user