Ends in:
5 DAYS
19 HRS
55 MIN
51 SEC
Ends in:
5 D
19 H
55 M
51 S

Activities of "zhongfang"

I wrote my functions to read the value I need. I am testing and waiting answers from you.

    namespace Yee.Change.Common.WebShared.IdentityServers
{
    using System;
    using System.Linq;
    using System.Text;
    using Newtonsoft.Json;
    using Volo.Abp.Settings;
    using System.Threading.Tasks;
    using System.Collections.Generic;

    public class SettingUtils
    {
        public async Task<string> GetSetting(ISettingProvider settingProvider, string externalProviderSchema, string name)
        {
            string json = await settingProvider.GetOrNullAsync("Abp.Account.ExternalProviders");
            if (string.IsNullOrWhiteSpace(json))
            {
                throw new Exception("json is null");
            }

            List<ExternalProviderSettings> providers = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ExternalProviderSettings>>(json);

            ExternalProviderSettings externalProvider = providers.FirstOrDefault(p => p.Name == externalProviderSchema);

            PropertityInfo properti = externalProvider.Propertities.First(p => p.Name == name);
            if (properti != null)
            {
                return properti.Value;
            }
            return string.Empty;

        }
    }

    public class ExternalProviderSettings
    {
        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("enabled")]
        public bool Enabled { get; set; }

        [JsonProperty("properties")]
        public List<PropertityInfo> Propertities { get; set; }

        [JsonProperty("secretProperties")]
        public List<PropertityInfo> SecretPropertities { get; set; }
    }

    public class PropertityInfo
    {
        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("value")]
        public string Value { get; set; }
    }
}

Oh, may I use as below?

string providers= await this.SettingProvider.GetOrNullAsync("Abp.Account.ExternalProviders");

I created 2 files as below

Yee.EasyComment.Application.Contracts.Users

    public class AppUserDto : IdentityUserDto
    {
    }
        

Yee.EasyComment.Domains.Users

    public class AppUser : IdentityUser
    {
    }
  • ABP Framework version: v5.1.4
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

https://community.abp.io/posts/abp-suite-how-to-add-the-user-entity-as-a-navigation-property-of-another-entity-furp75ex

I follow above topic. But I got an error. (await GetDbContextAsync()).Users There is no property named Users in EasyCommentDbContext.

 protected virtual async Task<IQueryable<CommentWithNavigationProperties>> GetQueryForNavigationPropertiesAsync()
        {
            return from comment in (await GetDbSetAsync())
                   join appUser in (await GetDbContextAsync()).Users on comment.AppUserId equals appUser.Id into users
                   from appUser in users.DefaultIfEmpty()

                   select new CommentWithNavigationProperties
                   {
                       Comment = comment,
                       AppUser = appUser
                   };
        }
  • ABP Framework version: v5.1.4
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no Abp provide a good way to configure dynamic optons for OAuth login. I can configure the valu for every tenant. And it is working. Every tenant can use it's own value while OAuth remote login.
 context.Services.AddAuthentication()
            .AddGoogle(GoogleDefaults.AuthenticationScheme, _ => { })
            .WithDynamicOptions<GoogleOptions, GoogleHandler>(
                GoogleDefaults.AuthenticationScheme,
                options =>
                {
                    options.WithProperty(x => x.ClientId);
                    options.WithProperty(x => x.ClientSecret, isSecret: true);
                }
            )

My question is How to get the danymic option manually? I wan't to use it in Volo.Abp.Account.Pro.Publick.Web.Pages.Accounts.Login.cshtml.cs I must use the values of the danymicoption in below stage.

 [UnitOfWork]
        public virtual async Task<IActionResult> OnGetExternalLoginCallbackAsync(string returnUrl = "", string returnUrlHash = "", string remoteError = null)

My question can be change to:

If I save feature value for tenant version. Then I can't change the feature value for a single tenant?

Now, I can control the menuitem with IFetureChecker. But another question ... can not change the feature value for a single tenant ater save the value for version.

OK. I see. I will try later.

another question, I have define features. But after I saved for tenant version. I can not change the value for a single tenant.

  • ABP Framework version: v5.1.4
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: The tenant without the feature will see the menu item.
  • Steps to reproduce the issue:" I have successfully create the feature definition. And the value of the feature is false. I want that the tenant without the feature can not see the menuitem...

    public class RmsMenuContributor : IMenuContributor
    {

        public RmsMenuContributor()
        {
        }

        public async Task ConfigureMenuAsync(MenuConfigurationContext context)
        {
            bool isGranted = await context.AuthorizationService.IsGrantedAsync(Yee.Change.Common.Permissions.AdminPermissions.Admin.Default);

            if (!isGranted)
            {
                return;
            }

            this._L = context.GetLocalizer<RmsResource>();

            if (context.Menu.Name == StandardMenus.Main)
            {
                await ConfigureMainMenuAsync(context);
            }

            await SetAiRulesMenu(context);

            await SetDic(context);

            await SetZipingBazi(context);

            await SetLianshanMenus(context);

            await SetLiuyaoMenus(context);

            await SetKanyuMenus(context);

            await SetBasicMenu(context);

            await SetTestResultMenu(context);

            await SetOperationMenu(context);

            await SetProductsMenu(context);
        }

        [RequiresFeature(Yee.Change.ZipingBazi.Features.ZipingBaziFeature.IsEnabled)]
        public virtual async Task SetOperationMenu(MenuConfigurationContext context)
        {
            var operateMenu = AddOperateMenuItem(context);

            AddMenuItemPictures(context, operateMenu);

            AddMenuItemUploadPicture(context, operateMenu);

I replaced all abp.auth.isGranted('Config. with abp.auth.isGranted('ChangeConfig.

The problem has been resolved.

Showing 101 to 110 of 166 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 26, 2024, 12:49