|
|
|
@ -33,10 +33,13 @@ func (this *BaseBean) PanicError(err error) { |
|
|
|
// find the current user from request.
|
|
|
|
func (this *BaseBean) findUser(request *http.Request) *User { |
|
|
|
|
|
|
|
//try to find from SessionCache.
|
|
|
|
sessionId := util.GetSessionUuidFromRequest(request, core.COOKIE_AUTH_KEY) |
|
|
|
sessionId := request.FormValue("access_token") //支持私有文件预览,优先获取access_token
|
|
|
|
if sessionId == "" { |
|
|
|
return nil |
|
|
|
//try to find from SessionCache.
|
|
|
|
sessionId = util.GetSessionUuidFromRequest(request, core.COOKIE_AUTH_KEY) |
|
|
|
if sessionId == "" { |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
cacheItem, err := core.CONTEXT.GetSessionCache().Value(sessionId) |
|
|
|
|