Atividades de "maliming"

https://github.com/abpframework/abp/pull/19870

hi

Try to add a CachedDynamicFileProvider class to get files from Redis cache.

CachedDynamicFileProvider:

using System;
using System.Collections.Generic;
using Microsoft.Extensions.FileProviders;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.VirtualFileSystem;

namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;

[Dependency(ReplaceServices = true)]
public class CachedDynamicFileProvider : DynamicFileProvider
{
    protected IDistributedCache<InMemoryFileInfoCacheItem> Cache { get; }

    public CachedDynamicFileProvider(IDistributedCache<InMemoryFileInfoCacheItem> cache)
    {
        Cache = cache;
    }

    public override IFileInfo GetFileInfo(string? subpath)
    {
        if (subpath == null)
        {
            return new NotFoundFileInfo(subpath!);
        }

        var file = DynamicFiles.GetOrDefault(NormalizePath(subpath));
        if (file == null && (subpath.Contains(".js", StringComparison.OrdinalIgnoreCase) || subpath.Contains(".css", StringComparison.OrdinalIgnoreCase)))
        {
            var cacheItem = Cache.Get(NormalizePath(subpath));
            if (cacheItem == null)
            {
                return new NotFoundFileInfo(subpath);
            }

            var inMemoryFile = new InMemoryFileInfo(NormalizePath(subpath), cacheItem.FileContent, cacheItem.Name);
            DynamicFiles.AddOrUpdate(NormalizePath(subpath), inMemoryFile, (key, value) => inMemoryFile);
            return inMemoryFile;
        }

        return file ?? new NotFoundFileInfo(subpath);
    }

    public override void AddOrUpdate(IFileInfo fileInfo)
    {
        var filePath = fileInfo.GetVirtualOrPhysicalPathOrNull();
        Cache.GetOrAdd(filePath!, () => new InMemoryFileInfoCacheItem(filePath!, fileInfo.ReadBytes(), fileInfo.Name));
        DynamicFiles.AddOrUpdate(filePath!, fileInfo, (key, value) => fileInfo);
        ReportChange(filePath!);
    }

    public override bool Delete(string filePath)
    {
        Cache.Remove(filePath);
        if (!DynamicFiles.TryRemove(filePath, out _))
        {
            return false;
        }

        ReportChange(filePath);
        return true;
    }
}

InMemoryFileInfoCacheItem

using System;
using Volo.Abp.MultiTenancy;

namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling;

[Serializable]
[IgnoreMultiTenancy]
public class InMemoryFileInfoCacheItem
{
    public InMemoryFileInfoCacheItem(string dynamicPath, byte[] fileContent, string name)
    {
        DynamicPath = dynamicPath;
        Name = name;
        FileContent = fileContent;
    }

    public string DynamicPath { get; set; }

    public string Name { get; set; }

    public byte[] FileContent { get; set; }
}

Responder

Great

hi

You can inject the ILanguageTextRepository to maintain(get/set) your localization info.

Responder

hi

You can try that:

app.Use(async (httpContext, next) =>
{
    if (!httpContext.Request.Path.ToString().Contains("account/login"))
    {
        if (httpContext.User.Identity is not { IsAuthenticated: true })
        {
            ///crm-aday-details?adayId=4503#0
            var path = httpContext.Request.GetEncodedPathAndQuery();
            if (path.IsNullOrWhiteSpace() || path == "/")
            {
                httpContext.Response.Redirect("/account/login");
            }
            else
            {
                httpContext.Response.Redirect("/account/login?returnUrl=" + path);
            }

            return;
        }
    }

    await next();
});
Responder
var yourPage = get page(querystring) from httpcontext
httpContext.Response.Redirect("/account/login?returnUrl=" + yourPage);

Thank you for the information. I will check it out in depth.

Responder

ok, I will check it.

Responder

hi

You can use the URL like: https://localhost:44309/account/login?returnUrl=/MyPage The returnUrl parameter can do this.

hi

I have checked the logs. There is no problem with the authserver website.

The Android app doesn't send the authorization_code request like IOS does.

So this is a client problem. Can you check if there are any client logs?

Mostrando 1 até 10 de 6729 registros
Made with ❤️ on ABP v8.2.0-preview Updated on março 25, 2024, 15:11