U:调整所有代码格式
This commit is contained in:
1 parent
d133bacf55
commit
155b67e831
342 files changed
+9431
-9868
No files matched your search
@@ -48,7 +48,7 @@ public class AuthController : BaseController
|
||||
var token = GenerateSimpleToken(username);
|
||||
|
||||
// 设置 Cookie
|
||||
SetCookie(context, "auth_token", token, expiresInSeconds: 3600);
|
||||
SetCookie(context, "auth_token", token, 3600);
|
||||
|
||||
await WriteSuccessResponseAsync(context, new
|
||||
{
|
||||
@@ -156,7 +156,7 @@ public class AuthController : BaseController
|
||||
}
|
||||
|
||||
var newToken = GenerateSimpleToken(username);
|
||||
SetCookie(context, "auth_token", newToken, expiresInSeconds: 3600);
|
||||
SetCookie(context, "auth_token", newToken, 3600);
|
||||
|
||||
await WriteSuccessResponseAsync(context, new
|
||||
{
|
||||
@@ -199,8 +199,8 @@ public class SimpleAuthenticationProvider : IAuthenticationProvider
|
||||
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim(ClaimTypes.Name, username),
|
||||
new Claim(ClaimTypes.Role, role)
|
||||
new(ClaimTypes.Name, username),
|
||||
new(ClaimTypes.Role, role)
|
||||
};
|
||||
|
||||
var identity = new ClaimsIdentity(claims, "SimpleAuth");
|
||||
@@ -216,4 +216,4 @@ public class SimpleAuthenticationProvider : IAuthenticationProvider
|
||||
|
||||
return Task.FromResult<ClaimsPrincipal?>(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user