FubuMVC를 사용하는 웹 응용 프로그램의 경우 CurrentUserPropertyBinder (아래 참조)을 구현했습니다.CurrentUserPropertyBinder 문제는 항상 사용자를 기억할 수 없습니다.
public class CurrentUserPropertyBinder : IPropertyBinder
{
private readonly Database _database;
private readonly ISecurityContext _security;
public CurrentUserPropertyBinder(Database database, ISecurityContext security)
{
_database = database;
_security = security;
}
public bool Matches(PropertyInfo property)
{
return property.PropertyType == typeof(User)
&& property.Name == "CurrentUser";
}
public void Bind(PropertyInfo property, IBindingContext context)
{
var currentUser = //check database passing the username to get further user details using _security.CurrentIdentity.Name
property.SetValue(context.Object, currentUser, null);
}
}
내 사이트에 로그인하면 정상적으로 작동합니다. 나는 시도하고 fineUploader을 사용하여 파일을 가져올 때 CurrentUserPropertyBinder는이 작업을 수행하는 데 필요한 모든 정보를 가지고
(즉 _security.CurrentIdentity.Name가 올바른 사용자 정보를 가지고) (http://fineuploader.com/)이있는이 열립니다 표준 파일 다이얼로그 _security.CurrentIdentity.Name은 비어 있습니다.
사용자가 누군지 기억하지 못하는 것 같습니다. 이유를 모르겠습니다. 다른 모든 경로에서 작동하지만 사용자를 기억하지 못할 파일을 가져옵니다.
도와주세요! 미리 감사드립니다
참고 : 우리는 나는이에 대한 조치를 추측하고있어
FubuMVC.Authentication 또는 다른 것을 사용하여 사용자를 인증하고 있습니까? – ventaur
우리는 사용자를 인증하기 위해 FubuMVC.Authentication을 사용하고 있습니다. –