Activities of "piseth"

I publish the website on my local PC. Then I copy the publish folder to paste in wwwroot in my server. my server has no Internet connection. **I will try run abp install-libs before publish it. ** By the way, currently i use the default appsettings.json which "App": { "SelfUrl":"https://localhost:44346" }, "AuthServer": { "Authority":"https://localhost:44346", "RequireHttpsMetadata":"false" },...

On my server, i want to browse http://10.10.0.1 or https://10.10.0.1 => Should I change my default appsettings.json?

Thanks

Is it correct?

public async Task<List<Student>> GetStudentAsync(CancellationToken cancellationToken = default)
{
         var name = new OracleParameter("Name", OracleDbType.Varchar2, ParameterDirection.Output);
         var address = new OracleParameter("Address", OracleDbType.Varchar2, ParameterDirection.Output);
        
       using (var command = CreateCommand("BEGIN GetStudent(:Name, :Address,);END;", CommandType.Text, new OracleParameter[] { name, address }))
            {
                return ((List<Student>)await command.ExecuteScalarAsync(cancellationToken));
            }
 }

private DbCommand CreateCommand(string commandText, CommandType commandType, params OracleParameter[] parameters)
{
    var command = DbContext.Database.GetDbConnection().CreateCommand();

    command.CommandText = commandText;
    command.CommandType = commandType;
    command.Transaction = DbContext.Database.CurrentTransaction?.GetDbTransaction();

    foreach (var parameter in parameters)
    {
        command.Parameters.Add(parameter);
    }

    return command;
}

hi

I think you just need to change the syntax of the SQL server to the oracle, the principle is the same.

https://github.com/abpframework/abp-samples/blob/master/StoredProcedureDemo/src/StoredProcedureDemo.EntityFrameworkCore/EntityFrameworkCore/Users/AppUserRepository.cs#L27-L40

Thank for your reply. please share me a sample function to do that. I don't know that is why i requested you. Honestly, I will copy and paste into my application.

Hello,

My Abp is MVC Razor with Oracle. I'd like to know how to work with Oracle Procedure?

The following sample is working with Store Procedure, but it is for SQL Server. https://github.com/abpframework/abp-samples/tree/master/StoredProcedureDemo

How can i make my project work with Oracle procedure?

Thanks in advance

I already use the latest version. I don't know what is the matter with it.

Now i manage to solve it by customize Login page, and i write extra code by override OnPostAsync(string action)

if (!_validatorService.HasRequestValidCaptchaEntry(Language.English, DisplayMode.ShowDigits)) { Alerts.Danger("Please Enter Valid Captcha."); }

Please recommend if it not a good practice to override OnPostAsync(string action) of Login.cshtml.cs

Hello, I really don't know what is the difference between Abp new version with dotent 6 and the old version. I know it is not the problem with your Abp. I may need your help. My old Abo (version 4.3.3) with dotnet 5 is working normally with DNTCaptcha. **Without having to write any C# code in CustomLogin.cs, i just add the following codes in Login.cshtml and it works with the help of validating the provided captcha code for me:

<abp-script src="/libs/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js" /> <abp-script src="/libs/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js" /> <abp-script src="/libs/jquery-validation/jquery.validate.js" /> <abp-script src="/libs/jquery/jquery.js" />

<dnt-captcha asp-captcha-generator-max="999999" asp-captcha-generator-min="111111" asp-captcha-generator-language="English" asp-captcha-generator-display-mode="ShowDigits" asp-use-relative-urls="true" asp-placeholder="Enter Security code" asp-validation-error-message="Please enter the security code." asp-font-name="Tahoma" asp-font-size="20" asp-fore-color="#333333" asp-back-color="#ccc" asp-text-box-class="text-box form-control" asp-text-box-template="<div class='input-group'><span class='input-group-prepend'><span class='input-group-text'><i class='fas fa-lock'></i></span></span>{0}</div>" asp-validation-message-class="text-danger" asp-refresh-button-class="fas fa-redo btn-sm" />**

It is strange with the new version. It seems jquery.validate.unobtrusive.js jquery.validate.js not validating for me

public class CustomLoginModel : LoginModel {

    private readonly IDNTCaptchaValidatorService _validatorService;
    private readonly DNTCaptchaOptions _captchaOptions;

    public CustomLoginModel(
        Microsoft.AspNetCore.Authentication.IAuthenticationSchemeProvider schemeProvider,
        IOptions&lt;Volo.Abp.Account.Public.Web.AbpAccountOptions&gt; accountOptions,
        IAbpRecaptchaValidatorFactory abpRecaptchaValidatorFactory,
        IAccountExternalProviderAppService accountExternalProviderAppService,
        ICurrentPrincipalAccessor currentPrincipalAccessor,
        IOptions&lt;IdentityOptions&gt; identityOptions,
        IOptionsSnapshot&lt;reCAPTCHAOptions&gt; reCaptchaOptions,
        IDNTCaptchaValidatorService validatorService,
        IOptions&lt;DNTCaptchaOptions&gt; options
        )
        : base(schemeProvider: schemeProvider,
              accountOptions: accountOptions,
              recaptchaValidatorFactory: abpRecaptchaValidatorFactory,
              accountExternalProviderAppService: accountExternalProviderAppService,
              currentPrincipalAccessor: currentPrincipalAccessor,
              identityOptions: identityOptions,
              reCaptchaOptions: reCaptchaOptions
              )
    {
        _validatorService = validatorService;
        _captchaOptions = options == null ? throw new ArgumentNullException(nameof(options)) : options.Value;
    }

    public override async Task&lt;IActionResult&gt; OnPostAsync(string action)
    {
         1/ I want to implement default Abp's implementation
         2/ Want extra checking DNT Captcha whether it is correct or not
         if correct => success login and go to Homepage
         else => not success login 
    }


    

}

By the way, I have to customize Login page. I am trying to follow this tutorial: https://community.abp.io/articles/how-to-customize-the-login-page-for-mvc-razor-page-applications-9a40f3cd

how can i validate DNTCaptcha in the Login page? Please help

This issue does not appear to be related to ABP. I found the following issue with short research and I wanted to share it in case it might help.

https://github.com/VahidN/DNTCaptcha.Core/issues/96

See also: https://community.abp.io/articles/patch-for-chrome-login-issue-identityserver4-samesite-cookie-problem-weypwp3n

Thank you so much.

I manage to fix successfully to show the Captcha image, but with the new version I have to write some extra code to validate the captcha number in Login.cshtml. So i try to write code like below:

public class LoginModel : PageModel {

    private readonly IDNTCaptchaValidatorService _validatorService;
    private readonly DNTCaptchaOptions _captchaOptions;

    public LoginModel(
        IDNTCaptchaValidatorService validatorService,
        IOptions&lt;DNTCaptchaOptions&gt; options

, Microsoft.AspNetCore.Authentication.IAuthenticationSchemeProvider schemeProvider) {

        _validatorService = validatorService;
        _captchaOptions = options == null ? throw new ArgumentNullException(nameof(options)) : options.Value;
    }

    public IActionResult OnPost()
    {
        if (!_validatorService.HasRequestValidCaptchaEntry(Language.English, DisplayMode.NumberToWord))
        {
            this.ModelState.AddModelError(_captchaOptions.CaptchaComponent.CaptchaInputName, "Please enter the security code as a number.");
            return Page();
        }

        //TODO: save data

        return RedirectToPage("privacy");
    }

    public void OnGet()
    {
    }
}

But I get error at the CustomLoginModel.cs. Please see the attachement:

Try abp install-libs

https://github.com/abpframework/abp/blob/dev/docs/en/Migration-Guides/Abp-5-0-MVC.md#use-install-libs-by-default

I try the abp install-libs and now i can run my application, but I have a problem with DNTCaptcha. Could you please help me solving it? GET https://localhost:44385/DNTCaptchaImage/Show?data=uc-XADIWBALybkfq-Jz6AIoCEzZMZdfxiCdhb_9sblBIoJ7Ctu5x-_nQ1ZbPgVgwUxqZt1PLsbBoqr0TCyfpBQ 400 (Bad Request)

顯示 82 個紀錄的 41 到 50 個.
Made with ❤️ on ABP v8.2.0-preview Updated on 3月 25, 2024, 15:11