- v2 ChangeMobile

This commit is contained in:
gazebo
2019-03-04 14:36:00 +08:00
parent f65f3dfadb
commit 9a581f1eba
5 changed files with 59 additions and 25 deletions

View File

@@ -122,6 +122,14 @@ func (ctx *Context) GetLoginInfo() IAuther {
return ctx.userInfo
}
func (ctx *Context) GetV2AuthInfo() (authInfo *auth2.AuthInfo, err error) {
authInfo, ok := ctx.userInfo.(*auth2.AuthInfo)
if ok {
return authInfo, nil
}
return nil, auth2.ErrNeedV2Token
}
func (ctx *Context) GetRootTask() tasksch.ITask {
ctx.locker.RLock()
defer ctx.locker.RUnlock()