xf 8 tháng trước cách đây
mục cha
commit
39e1f47a2a
1 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 17 0
      src/Hotline.Api/Controllers/TestController.cs

+ 17 - 0
src/Hotline.Api/Controllers/TestController.cs

@@ -669,6 +669,23 @@ ICallApplication callApplication,
         return DateTime.Now.ToString("O");
     }
 
+    [AllowAnonymous]
+    [HttpGet("t5")]
+    public async Task<string> GetUserAllowAnonymous()
+    {
+        var users = await _userRepository.Queryable()
+            .FirstAsync(d => d.Name == "xf", HttpContext.RequestAborted);
+        return users.Id;
+    }
+
+    [HttpGet("t6")]
+    public async Task<string> GetUserWithAuth()
+    {
+        var users = await _userRepository.Queryable()
+            .FirstAsync(d => d.Name == "xf", HttpContext.RequestAborted);
+        return users.Id;
+    }
+
     [HttpGet("rsa")]
     public async Task<string> Rsa()
     {