@using TechHelper.Client.Services
<MudPaper Height="50" Width="50" Outlined="true">

	<MudButton Variant="Variant.Filled" OnClick="Restore"> Restore Role </MudButton>

</MudPaper>
@code {
	[Inject]
	public IAuthenticationClientService Authentication { get; set; }
	[Inject]
	public IUserServices UserServices { get; set; }
	[Inject]
	public ISnackbar Snackbar { get; set; }
	private async Task Restore()
	{
		var result = await UserServices.RestoreUserInfo();
		if (result.Status)
		{

			Snackbar.Add("更新成功", Severity.Success);

		}
		else
			Snackbar.Add("更新失败", Severity.Error);
		var token = await Authentication.RefreshTokenAsync();
		if (token != null)
			Snackbar.Add("刷新令牌成功", Severity.Success);
		else
			Snackbar.Add("刷新令牌失败,你可以手动刷新", Severity.Warning);
		StateHasChanged();
	}


}
