- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 AspBoilerPlate 作为框架,因为它看起来非常好,而且我一直很难尝试在 Owin Identity 上实现 Multi-Tenancy (几天前我发布了一个问题:Asp.Net Identity Multitenant
我下载了 Asp.Net MVC,这样我就可以移植我已有的代码,我可以从头开始加载创建用户、租户,但是,在任何 View 上,如果我单击“编辑”,就会显示发生错误,在登录 View 中,如果我单击“更改租户”,则会发生错误。
这是我采取的步骤(尝试了 ASP.Net MVC 和 Core 版本):
它可以工作,但会出现我上面描述的错误。
我在 VS 上使用了单步执行函数来尝试获取真正的错误,但它可能会在外部 dll 或其他东西上捕获它,这是仅执行 Load-Login-Changetenant(error) 的干净 log.txt -登录 - 编辑租户(错误)
DEBUG 2019-09-24 13:12:59,986 [1 ] Abp.Modules.AbpModuleManager - Found 17 ABP modules in total.
DEBUG 2019-09-24 13:12:59,995 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.Web.myapplicationWebModule, myapplication.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,997 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.myapplicationDataModule, myapplication.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,997 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.EntityFramework.AbpZeroEntityFrameworkModule, Abp.Zero.EntityFramework, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,998 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.AbpZeroCoreModule, Abp.Zero, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,999 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.AbpZeroCommonModule, Abp.Zero.Common, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,999 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AbpKernelModule, Abp, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,006 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFramework.AbpEntityFrameworkModule, Abp.EntityFramework, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,006 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFramework.AbpEntityFrameworkCommonModule, Abp.EntityFramework.Common, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,007 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.myapplicationCoreModule, myapplication.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,007 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.myapplicationApplicationModule, myapplication.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,012 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AutoMapper.AbpAutoMapperModule, Abp.AutoMapper, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,012 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.Api.myapplicationWebApiModule, myapplication.WebApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,013 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.WebApi.AbpWebApiModule, Abp.Web.Api, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,013 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.AbpWebModule, Abp.Web, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,013 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.AbpWebCommonModule, Abp.Web.Common, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,014 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.SignalR.AbpWebSignalRModule, Abp.Web.SignalR, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,014 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.Mvc.AbpWebMvcModule, Abp.Web.Mvc, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,018 [1 ] Abp.Modules.AbpModuleManager - 17 modules loaded.
DEBUG 2019-09-24 13:13:03,252 [1 ] o.Configuration.LanguageManagementConfig - Converted Abp (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2019-09-24 13:13:03,252 [1 ] o.Configuration.LanguageManagementConfig - Converted AbpZero (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2019-09-24 13:13:03,252 [1 ] o.Configuration.LanguageManagementConfig - Converted myapplication (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2019-09-24 13:13:03,252 [1 ] o.Configuration.LanguageManagementConfig - Converted AbpWeb (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2019-09-24 13:13:03,865 [1 ] EntityFramework.AbpEntityFrameworkModule - Registering DbContext: myapplication.EntityFramework.myapplicationDbContext, myapplication.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:06,085 [1 ] Abp.Localization.LocalizationManager - Initializing 4 localization sources.
DEBUG 2019-09-24 13:13:06,161 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: Abp
DEBUG 2019-09-24 13:13:06,219 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpZero
DEBUG 2019-09-24 13:13:06,247 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: myapplication
DEBUG 2019-09-24 13:13:06,280 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpWeb
DEBUG 2019-09-24 13:13:06,391 [1 ] Abp.BackgroundJobs.BackgroundJobManager - Start background worker: Castle.Proxies.BackgroundJobManagerProxy
DEBUG 2019-09-24 13:13:06,468 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Found 11 classes define auto mapping attributes
DEBUG 2019-09-24 13:13:06,469 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Sessions.Dto.TenantLoginInfoDto
DEBUG 2019-09-24 13:13:06,477 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Sessions.Dto.UserLoginInfoDto
DEBUG 2019-09-24 13:13:06,478 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Users.Dto.CreateUserDto
DEBUG 2019-09-24 13:13:06,479 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Users.Dto.UpdateUserDto
DEBUG 2019-09-24 13:13:06,479 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Users.Dto.UserDto
DEBUG 2019-09-24 13:13:06,479 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Roles.Dto.PermissionDto
DEBUG 2019-09-24 13:13:06,479 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.MultiTenancy.Dto.CreateTenantDto
DEBUG 2019-09-24 13:13:06,480 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.MultiTenancy.Dto.EditTenantDto
DEBUG 2019-09-24 13:13:06,480 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.MultiTenancy.Dto.TenantDto
DEBUG 2019-09-24 13:13:06,480 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Web.Models.Account.TenantChangeViewModel
DEBUG 2019-09-24 13:13:06,480 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Web.Models.Account.TenantSelectionViewModel+TenantInfo
DEBUG 2019-09-24 13:13:08,736 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Sessions.ISessionAppService' with service name 'app/session'.
DEBUG 2019-09-24 13:13:08,737 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Users.IUserAppService' with service name 'app/user'.
DEBUG 2019-09-24 13:13:08,738 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Roles.IRoleAppService' with service name 'app/role'.
DEBUG 2019-09-24 13:13:08,739 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.MultiTenancy.ITenantAppService' with service name 'app/tenant'.
DEBUG 2019-09-24 13:13:08,740 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Configuration.IConfigurationAppService' with service name 'app/configuration'.
DEBUG 2019-09-24 13:13:08,741 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Authorization.Accounts.IAccountAppService' with service name 'app/account'.
WARN 2019-09-24 13:13:26,032 [6 ] Abp.Logging.LogHelper - Abp.Authorization.AbpAuthorizationException: Current user did not login to the application!
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<CheckPermissions>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
at Abp.Authorization.AuthorizationHelperExtensions.Authorize(IAuthorizationHelper authorizationHelper, MethodInfo methodInfo, Type type)
at Abp.Web.Mvc.Authorization.AbpMvcAuthorizeFilter.OnAuthorization(AuthorizationContext filterContext)
Abp.Authorization.AbpAuthorizationException: Current user did not login to the application!
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<CheckPermissions>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
at Abp.Authorization.AuthorizationHelperExtensions.Authorize(IAuthorizationHelper authorizationHelper, MethodInfo methodInfo, Type type)
at Abp.Web.Mvc.Authorization.AbpMvcAuthorizeFilter.OnAuthorization(AuthorizationContext filterContext)
DEBUG 2019-09-24 13:15:15,987 [12 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is connected: {"ConnectionId":"93594c5a-5aa2-40be-af8e-c3487535bd12","IpAddress":"192.168.42.1","TenantId":null,"UserId":1,"ConnectTime":"2019-09-24T13:15:15.9774976-06:00","Properties":{}}
DEBUG 2019-09-24 13:15:16,020 [6 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is registered: 93594c5a-5aa2-40be-af8e-c3487535bd12
DEBUG 2019-09-24 13:15:28,150 [10 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is disconnected: 93594c5a-5aa2-40be-af8e-c3487535bd12
DEBUG 2019-09-24 13:15:30,882 [12 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is connected: {"ConnectionId":"e9afe71e-bc64-4c18-a66c-a7381fae6701","IpAddress":"192.168.42.1","TenantId":null,"UserId":1,"ConnectTime":"2019-09-24T13:15:30.8823332-06:00","Properties":{}}
DEBUG 2019-09-24 13:15:30,889 [6 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is registered: e9afe71e-bc64-4c18-a66c-a7381fae6701
WARN 2019-09-24 13:15:35,697 [9 ] naries.DictionaryBasedLocalizationSource - Can not find 'EditTenant' in localization source 'myapplication'!
我想知道免费版本是否不能从头开始工作,我一直在寻找这样的错误,但每个人似乎都能让它工作,并在开始更改代码后遇到问题。
我在调试时没有收到错误的原因是因为在 javascript-ajax 调用、jquery.js 函数上发生了错误:
jQuery.parseJSON = function( data ) {
return JSON.parse( data + "" );
};
正在接收数据参数:
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">
<span>Change tenant</span>
</h4>
</div>
<div class="modal-body">
<form name="TenantChangeForm" role="form" novalidate class="form-validation">
<div class="form-group form-float">
<div class="form-line">
<input class="form-control" type="text" name="TenancyName" maxlength="64">
<label class="form-label">Tenancy name</label>
</div>
</div>
<span class="help-block">Leave empty to switch to the host</span>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default close-button waves-effect" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary save-button waves-effect">Save</button>
</div>
<script src="/Views/Account/_TenantChangeModal.js" type="text/javascript"></script>
女巫给出错误:SyntaxError: Unexpected token < in JSON atposition 0.
并返回 abp.jquery.js :
}).fail(function (jqXHR) {
if (jqXHR.responseJSON && jqXHR.responseJSON.__abp) {
abp.ajax.handleResponse(jqXHR.responseJSON, userOptions, $dfd, jqXHR);
} else {
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
}
我一直在寻找,所有模态框都不会显示,并且所有 View 都包含一个 JS 来显示,如下所示:
(function () {
$('.tenant-change-component a')
.click(function (e) {
e.preventDefault();
abp.ajax({
url: abp.appPath + 'Account/TenantChangeModal',
type: 'POST',
contentType: 'application/html',
success: function (content) {
$('#TenantChangeModal div.modal-content').html(content);
},
error: function (e) { }
});
});
})();
问题与模式有关,但仅在更改租户和编辑租户时,如果我尝试创建租户或用户,它会起作用。
进入 JSON.Parse 并接收整个 View 作为参数后,它会出现解析器错误,并且:jqXHR.status 获取状态 200。
向数据变量添加了一个监视,并且使用有效的模式永远不会获得整个 View ,因为参数保持为空。尝试修改函数以始终返回 null,但屏幕只会变暗。
还尝试将jquery.js更新到2.2.4(下面3),因为模板使用2.2.0。仍然是同样的问题。
最佳答案
我在 GitHub 上发布了这个问题: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4889
通过对触发模式的 View 的 Index.js(或 Default.js)进行一些更改可以解决这个问题:
Replace: $.ajax({
With: abp.ajax({
和
Replace: contentType: 'application/html',
With: dataType: 'html',
代表提问者添加。
关于javascript - 修复 aspnetboilerplate 启动模板、租户或编辑错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58087212/
我有一个 html 格式的表单: 我需要得到 JavaScript在value input 字段执行,但只能通过表单的 submit .原因是页面是一个模板所以我不控制它(不能有
我管理的论坛是托管软件,因此我无法访问源代码,我只能向页面添加 JavaScript 来实现我需要完成的任务。 我正在尝试用超链接替换所有页面上某些文本关键字的第一个实例。我还根据国家/地区代码对这些
我正在使用 JS 打开新页面并将 HTML 代码写入其中,但是当我尝试使用 document.write() 在新页面中编写 JS 时功能不起作用。显然,一旦看到 ,主 JS 就会关闭。用于即将打开的
提问不是为了解决问题,提问是为了更好地理解系统 专家!我知道每当你将 javascript 代码输入 javascript 引擎时,它会立即由 javascript 引擎执行。由于没有看过Engi
我在一个文件夹中有两个 javascript 文件。我想将一个变量的 javascript 文件传递到另一个。我应该使用什么程序? 最佳答案 window.postMessage用于跨文档消息。使
我有一个练习,我需要输入两个输入并检查它们是否都等于一个。 如果是 console.log 正则 console.log false 我试过这样的事情: function isPositive(fir
我正在做一个Web应用程序,计划允许其他网站(客户端)在其页面上嵌入以下javascript: 我的网络应用程序位于 http://example.org 。 我不能假设客户端网站的页面有 JQue
目前我正在使用三个外部 JS 文件。 我喜欢将所有三个 JS 文件合而为一。 尽一切可能。我创建 aio.js 并在 aio.js 中 src="https://code.jquery.com/
我有例如像这样的数组: var myArray = []; var item1 = { start: '08:00', end: '09:30' } var item2 = {
所以我正在制作一个 Chrome 扩展,它使用我制作的一些 TamperMonkey 脚本。我想要一个“主”javascript 文件,您可以在其中包含并执行其他脚本。我很擅长使用以下行将其他 jav
我有 A、B html 和 A、B javascript 文件。 并且,如何将 A JavaScript 中使用的全局变量直接移动到 B JavaScript 中? 示例 JavaScript) va
我需要将以下整个代码放入名为 activate.js 的 JavaScript 中。你能告诉我怎么做吗? var int = new int({ seconds: 30, mark
我已经为我的 .net Web 应用程序创建了母版页 EXAMPLE1.Master。他们的 I 将值存储在 JavaScript 变量中。我想在另一个 JS 文件中检索该变量。 示例1.大师:-
是否有任何库可以用来转换这样的代码: function () { var a = 1; } 像这样的代码: function () { var a = 1; } 在我的浏览器中。因为我在 Gi
我收到语法缺失 ) 错误 $(document).ready(function changeText() { var p = document.getElementById('bidp
我正在制作进度条。它有一个标签。我想调整某个脚本完成的标签。在找到可能的解决方案的一些答案后,我想出了以下脚本。第一个启动并按预期工作。然而,第二个却没有。它出什么问题了?代码如下: HTML:
这里有一个很简单的问题,我简单的头脑无法回答:为什么我在外部库中加载时,下面的匿名和onload函数没有运行?我错过了一些非常非常基本的东西。 Library.js 只有一行:console.log(
我知道 javascript 是一种客户端语言,但如果实际代码中嵌入的 javascript 代码以某种方式与在控制台上运行的代码不同,我会尝试找到答案。让我用一个例子来解释它: 我想创建一个像 Mi
我如何将这个内联 javascript 更改为 Unobtrusive JavaScript? 谢谢! 感谢您的回答,但它不起作用。我的代码是: PHP js文件 document.getElem
我正在寻找将简单的 JavaScript 对象“转储”到动态生成的 JavaScript 源代码中的最优雅的方法。 目的:假设我们有 node.js 服务器生成 HTML。我们在服务器端有一个对象x。
我是一名优秀的程序员,十分优秀!