pull/4101/head
liangshiwei 5 years ago
parent 018fa25b9b
commit 70ecd18363

@ -1,13 +1,10 @@
(function($) {
var tenantSwitchModal = new abp.ModalManager();
var tenantSwitchModal = new abp.ModalManager(abp.appPath + 'Abp/MultiTenancy/TenantSwitchModal');
$(function() {
$('#AbpTenantSwitchLink').click(function(e) {
e.preventDefault();
tenantSwitchModal.setOptions({
viewUrl : abp.appPath + 'Abp/MultiTenancy/TenantSwitchModal'
})
tenantSwitchModal.open();
});

@ -46,6 +46,10 @@
@await Component.InvokeAsync(typeof(WidgetStylesViewComponent))
<script type="text/javascript">
var abp = abp || {}; abp.appPath = '@ApplicationPath';
</script>
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Account)
</head>
<body class="abp-account-layout bg-light">
@ -101,4 +105,4 @@
@await Component.InvokeLayoutHookAsync(LayoutHooks.Body.Last, StandardLayouts.Account)
</body>
</html>
</html>

@ -48,6 +48,10 @@
@await RenderSectionAsync("styles", false)
<script type="text/javascript">
var abp = abp || {}; abp.appPath = '@ApplicationPath';
</script>
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Application)
</head>
<body class="abp-application-layout bg-light">
@ -76,4 +80,4 @@
@await Component.InvokeLayoutHookAsync(LayoutHooks.Body.Last, StandardLayouts.Application)
</body>
</html>
</html>

@ -50,6 +50,10 @@
@await RenderSectionAsync("styles", false)
<script type="text/javascript">
var abp = abp || {}; abp.appPath = '@ApplicationPath';
</script>
@await Component.InvokeLayoutHookAsync(LayoutHooks.Head.Last, StandardLayouts.Empty)
</head>
<body class="abp-empty-layout">
@ -71,4 +75,4 @@
@await Component.InvokeLayoutHookAsync(LayoutHooks.Body.Last, StandardLayouts.Empty)
</body>
</html>
</html>

@ -1,4 +1,5 @@
@using System.Globalization
@inherits Volo.Abp.AspNetCore.Mvc.UI.RazorPages.AbpRazorPage<TModel>
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

@ -112,7 +112,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
$firstVisibleInput.focus();
});
var modalClass = abp.modals[_options.modalClass];
var modalClass = abp.modals[options.modalClass];
if (modalClass) {
_modalObject = new modalClass();
_modalObject.init && _modalObject.init(_publicApi, _args); //TODO: Remove later
@ -127,14 +127,14 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
_args = args || {};
_createContainer(_modalId)
.load(_options.viewUrl, $.param(_args), function (response, status, xhr) {
.load(options.viewUrl, $.param(_args), function (response, status, xhr) {
if (status === "error") {
//TODO: Handle!
return;
};
if (_options.scriptUrl) {
abp.ResourceLoader.loadScript(_options.scriptUrl, function () {
if (options.scriptUrl) {
abp.ResourceLoader.loadScript(options.scriptUrl, function () {
_initAndShowModal();
});
} else {
@ -192,10 +192,6 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
return _options;
},
setOptions: function(options){
_options = options;
},
setResult: function () {
_onResultCallbacks.triggerAll(_publicApi, arguments);
},

@ -0,0 +1,17 @@
using System;
using Microsoft.AspNetCore.Mvc.Razor;
namespace Volo.Abp.AspNetCore.Mvc.UI.RazorPages
{
public abstract class AbpRazorPage<TModel> : RazorPage<TModel>
{
public string ApplicationPath
{
get
{
string str = ViewContext.HttpContext.Request.PathBase.Value;
return str == null ? "/" : str.EnsureEndsWith('/');
}
}
}
}

@ -55,8 +55,6 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
script.AppendLine();
script.AppendLine($"$.extend(true, abp, {_jsonSerializer.Serialize(config, indented: true)})");
script.AppendLine();
script.AppendLine($"abp.appPath = abp.toAbsAppPath('{Request.PathBase}/')");
script.AppendLine();
script.AppendLine("abp.event.trigger('abp.configurationInitialized');");
script.AppendLine();
script.Append("})();");

@ -43,7 +43,7 @@ namespace Volo.Abp.VirtualFileExplorer.Web.Pages.VirtualFileExplorer
.Where(d => VirtualFileExplorerConsts.AllowFileInfoTypes.Contains(d.GetType().Name))
.OrderByDescending(f => f.IsDirectory).ToList();
PagerModel = new PagerModel(query.Count, PageSize, CurrentPage, PageSize, $"{ResolveUrl()}VirtualFileExplorer?Path={Path}&PageSize={PageSize}");
PagerModel = new PagerModel(query.Count, PageSize, CurrentPage, PageSize, $"{Url.Content("~/")}VirtualFileExplorer?Path={Path}&PageSize={PageSize}");
SetViewModel(query.Skip((CurrentPage - 1) * PageSize).Take(PageSize));
SetPathNavigation();
@ -72,7 +72,7 @@ namespace Volo.Abp.VirtualFileExplorer.Web.Pages.VirtualFileExplorer
fileInfoViewModel.Icon = "fas fa-folder";
fileInfoViewModel.FileType = "folder";
fileInfoViewModel.Length = "/";
fileInfoViewModel.FileName =$"<a href='{ResolveUrl()}VirtualFileExplorer?path={fileInfo.PhysicalPath}'>{fileInfo.Name}</a>";
fileInfoViewModel.FileName =$"<a href='{Url.Content("~/")}VirtualFileExplorer?path={fileInfo.PhysicalPath}'>{fileInfo.Name}</a>";
}
else
{
@ -87,7 +87,7 @@ namespace Volo.Abp.VirtualFileExplorer.Web.Pages.VirtualFileExplorer
{
var navigationBuild = new StringBuilder();
var pathArray = Path.Split('/').Where(p => !p.IsNullOrWhiteSpace());
var href = $"{ResolveUrl()}VirtualFileExplorer?path=";
var href = $"{Url.Content("~/")}VirtualFileExplorer?path=";
navigationBuild.Append($"<nav aria-label='breadcrumb'>" +
$" <ol class='breadcrumb'>" +
@ -103,13 +103,5 @@ namespace Volo.Abp.VirtualFileExplorer.Web.Pages.VirtualFileExplorer
PathNavigation = navigationBuild.ToString();
}
private string ResolveUrl()
{
var segment = new PathString("/");
var applicationPath = Request.PathBase;
return applicationPath.Add(segment).Value;
}
}
}

Loading…
Cancel
Save