日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

SAP Spartacus在某些屏幕尺寸下无法正常工作的原因分析

發(fā)布時間:2023/12/19 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SAP Spartacus在某些屏幕尺寸下无法正常工作的原因分析 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

有個使用SAP Spartacus的客戶遇到一個問題:

We are getting one issue in our Spartacus application (currently we are on 2.1 version).
When we are trying to load checkout-login page with 100% zoom in the browser, it is loading not-found page instead of checkout-login page and when the same page is refreshed with 90% zoom in the browser, we can see the correct checkout-login page with proper data.

這個問題乍一看有點(diǎn)奇怪,當(dāng)瀏覽器縮放比率為90%時,checkout-login 頁面可以正常工作,但是當(dāng)縮放率調(diào)至100%時,反而不能正常工作了,會顯示not-found頁面。

We checked the cms-page.guard.ts file in that it is going to canActivateNotFoundPage method instead of canActivatePage from canActivate Method.

原因分析

we found an error in “CustomOccCmsPageNormalizer” at:

問題是下面這段客戶自開發(fā)代碼引起的:

accountNavigationChildren = accountNavigationChildren.concat(supportComponentData.navigationNode );

It seems like “supportComponentData” is undefined in some case. This variable contains the “MySupportComponent” component from the response. Since “supportComponentData” is undefined an error is thrown which causes the “checkout-login” page rendering to fail. Spartacus then falls back to getting the “not found” page.

To explain further, in the “CmsPageGuard”, Spartacus calls “CmsService.getPage” which will try to load the checkout page.

Since there is an error in the page normalizer, the “CmsService” will return “false” to the “CmsPageGuard” meaning the page wasn’t rendered. The “CmsPageGuard” then goes ahead and requests the “not found” page.

Because of an “if statement” wrapping the failing logic, the problem is only visible for screen sizes between 768 and 1399 (inclusively).

這個問題只有在屏幕尺寸位于區(qū)間768~1399區(qū)域內(nèi)才能重現(xiàn)。

Additionally, we were not able to witness this same problem on the d1 server which might mean that the p1 server is missing the “MySupportComponent”.

總結(jié)

以上是生活随笔為你收集整理的SAP Spartacus在某些屏幕尺寸下无法正常工作的原因分析的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。