Blazor & WASM in combination to get statistics from Spotify API for performing the song analysis. With separate microservices for auth, Spotify, user data tracking, and application, connected through gRPC with Polly.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Callback.razor 930B

123456789101112131415161718192021222324252627282930313233
  1. @page "/callback"
  2. @using NemAnBlazor.Services.Interfaces
  3. @inject NavigationManager NavigationMgr
  4. @inject IAuthClientService AuthService
  5. <PageTitle>Callback page</PageTitle>
  6. <p role="status">Current count: @currentCount</p>
  7. <button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
  8. @code {
  9. private int currentCount = 0;
  10. private void IncrementCount()
  11. {
  12. currentCount++;
  13. }
  14. protected override async Task OnInitializedAsync()
  15. {
  16. string url = NavigationMgr.Uri;
  17. //code is the only parameter in the url
  18. string code = url.Split("=")[1];
  19. string redirectURI = "https://localhost:44342/"; //ovo promeni da se storuje negde na neko univerzalno mesto
  20. var response = await AuthService.GetAccessToken(new GrpcShared.DTO.Auth.TokenRequest { code = code, redirect_uri = redirectURI});
  21. //store access token in local storage
  22. }
  23. }