我正在使用ASP.net身份,它允許我配置為在未經(jīng)授權(quán)的情況下返回視圖,但是現(xiàn)在我想返回字符串,所以我需要做什么? app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"), Provider = new CookieAuthenticationProvider { OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>( validateInterval: TimeSpan.FromMinutes(30), regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)) }, ExpireTimeSpan = TimeSpan.FromMinutes(1), });
當(dāng)未經(jīng)授權(quán)的 asp.net 身份時(shí)返回一個(gè)字符串而不是一個(gè)視圖
千萬(wàn)里不及你
2021-05-05 06:05:41