首页 > 解决方案 > SAP Hybris 辅助服务模块 (ASM) - 双重登录

问题描述

我遇到了 ASM 模块的问题 - 有时会发生在登录操作之后,站点被刷新并且 ASM 未显示。
我发现在我登录的时候,请求同时发送了两次。然后它会导致在 DB 中找到重复键的错误。我认为主要问题是双重登录,但我不知道是什么原因造成的。

[RQ-XXX/user-POST /custom/cs/assisted-service/login] [ip] [AssistedServiceFacade] Agent [user] has been loged in using login form
[RQ-XXX/user-POST /custom/cs/assisted-service/login] [ip] [DefaultGUIDCookieStrategy] Setting guid cookie and session attribute: xxx
[RQ-XXX/user-POST /custom/cs/assisted-service/login] [ip] [AssistedServiceFacade] Agent [user] has been loged in using login form
[RQ-XXX/user-POST /custom/cs/assisted-service/login] [ip] [DefaultGUIDCookieStrategy] Setting guid cookie and session attribute: yyy
ERROR [RQ-end] [page] Error 200 shown
 Req: null
 User:user
 Session:xxx | msg:
java.io.IOException: Broken pipe
    at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
    at sun.nio.ch.IOUtil.write(IOUtil.java:65)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:468)
.
.

这是关键错误,但我不确定这是问题的主要原因。

ModelSavingException: [de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor@2f9e23c2]:Ambiguous unique keys {key=CxActionResults_XXX} for model CxResultsModel (<unsaved>) –  found 1 item(s) using the same keys

我试图用 .js 来防止这种情况,但没有帮助:

$("#asmLoginForm").on('submit', function (e) {
   e.preventDefault();
})

它不会每次都发生。

标签: javahybrisadd-on

解决方案


Turns out there was bad wro configuration. I had the .js files from ASM module twice on the site, once compiled in all_responsive.js file and once again in the addons/responsive part. So everytime I did submit, both two functions sent the request.


推荐阅读