(token string, uid int)
| 42 | } |
| 43 | |
| 44 | func (m *Auth) Insert(token string, uid int) (err error) { |
| 45 | m.DeleteByToken(token) |
| 46 | var auth = Auth{Token: token, Uid: uid} |
| 47 | _, err = orm.NewOrm().Insert(&auth) |
| 48 | if err != nil { |
| 49 | beego.Error(err.Error()) |
| 50 | return |
| 51 | } |
| 52 | m.clearMoreThanLimit(uid) |
| 53 | return |
| 54 | } |
| 55 | |
| 56 | func (m *Auth) clearMoreThanLimit(uid int) { |
| 57 | if maxLoginTerminal <= 0 { |
no test coverage detected