Hi,
This actually not related to ABP, you can check this: https://docs.microsoft.com/en-us/aspnet/core/security/docker-compose-https?view=aspnetcore-5.0
I wanted to let the user change it, specially in case the tenant with a given domain do not exists
Of course the user can change it when given domain do not exists. ABP will call the tenant resolver according to the priority until the resolution is successful.
Can not change priority or anything?
Yes you can :
Configure<AbpTenantResolveOptions>(option =>
{
option.TenantResolvers.Insert(1, new CookieTenantResolveContributor());
});
Hi,
Because the domain resolver has a higher priority than the cookie resolver.
Hi,
Seems it work for you. I will close the ticket, please open again if you still have problem.
package.json
{
"version": "1.0.0",
"name": "my-app",
"private": true,
"dependencies": {
......
"sweetalert2": "^11.0.18"
}
}
abp.resourcemapping.js
module.exports = {
aliases: {
},
mappings: {
"@node_modules/sweetalert2/dist/sweetalert2.all.min.js": "@libs/sweetalert2/dist"
}
};
Add global.js
to wwwroot
var abp = abp || {};
abp.libs = abp.libs || {};
abp.libs.sweetAlert = {
config: {
'default': {
},
info: {
icon: 'info'
},
success: {
icon: 'success'
},
warn: {
icon: 'warning'
},
error: {
icon: 'error'
},
confirm: {
icon: 'warning',
title: 'Are you sure?',
buttons: ['Cancel', 'Yes']
}
}
};
var showMessage = function (type, message, title) {
if (!title) {
title = message;
message = undefined;
}
var opts = $.extend(
{},
abp.libs.sweetAlert.config['default'],
abp.libs.sweetAlert.config[type],
{
title: title,
html: message
}
);
return $.Deferred(function ($dfd) {
Swal.fire(opts).then(function () {
$dfd.resolve();
});
// sweetAlert(opts).then(function () {
// $dfd.resolve();
// });
});
};
abp.message.info = function (message, title) {
return showMessage('info', message, title);
};
abp.message.success = function (message, title) {
return showMessage('success', message, title);
};
abp.message.warn = function (message, title) {
return showMessage('warn', message, title);
};
abp.message.error = function (message, title) {
return showMessage('error', message, title);
};
WebModule
private void ConfigureBundles()
{
Configure<AbpBundlingOptions>(options =>
{
options.StyleBundles.Configure(
BasicThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");
}
);
options.ScriptBundles.Configure(
BasicThemeBundles.Scripts.Global,
bundle =>
{
bundle.AddFiles("/libs/sweetalert2/dist/sweetalert2.all.min.js");
bundle.AddFiles("/global.js");
}
);
});
}
Hi,
Resource-based authorization in ASP.NET Core is standard way and is part of ASPNET Core Identity.
It abstracts the AuthorizationHandler
and allows you to customize the handler class.
It’s actually easier to use the second way, they are both ok. you can choose the way you like
See https://docs.abp.io/en/commercial/latest/startup-templates/microservice/gateways
Hi,
ABP using the SweetAlert library by default. but seems SweetAlert does not support html content.
You can use sweetAlert2 to replace it.
Hi,
Can you provide a project to reproduce? shiwei.liang@volosoft.com thanks.