Magento2消息管理器错误
在Magento2登录页面中,如果我们尝试使用错误的凭据登录,则错误消息(“无效登录或密码”)不会显示在同一页面上,并且只会显示在其他页面上的其他消息Magento2消息管理器错误,magento2,Magento2,在Magento2登录页面中,如果我们尝试使用错误的凭据登录,则错误消息(“无效登录或密码”)不会显示在同一页面上,并且只会显示在其他页面上的其他消息 我使用的是最新的Magento 2.0.2版本。Magento消息问题是因为它使用浏览器的本地存储 请将magento更新至最新版本,如果错误仍然存在,请在magento_Customer/js/Customer-data.js文件中使用此修补程序 您将在供应商目录中找到此文件 vendor/magento/module-customer/vi
我使用的是最新的Magento 2.0.2版本。Magento消息问题是因为它使用浏览器的本地存储 请将magento更新至最新版本,如果错误仍然存在,请在magento_Customer/js/Customer-data.js文件中使用此修补程序 您将在供应商目录中找到此文件
vendor/magento/module-customer/view/frontend/web/js/customer-data.js
app/code/Magento/Customer/view/frontend/web/js/customer-data.js
或应用程序内目录
vendor/magento/module-customer/view/frontend/web/js/customer-data.js
app/code/Magento/Customer/view/frontend/web/js/customer-data.js
编辑此文件并更新如下代码
36 var dataProvider = {
37 getFromStorage: function (sectionNames) {
38 var result = {};
39 _.each(sectionNames, function (sectionName) {
40 if(sectionName == 'messages'){
41 return;
42 }
43 console.log(sectionName);
44 result[sectionName] = storage.get(sectionName);
45 });
46 return result;
47 },
在此之后,您需要删除静态内容并部署文件
删除静态文件的步骤
转到pub/static文件夹并删除adminhtml、frontend、_requirejs文件夹
然后在命令下面运行
php bin/magento setup:static-content:deploy
这将在pub/static文件夹中部署您的更改,您将看到您的更改
pub/static/frontend/Magento/{yourtheme}/{localeCode}/Magento_Customer/js/customer-data.js
现在你完成了
清除浏览器缓存并选中:)Magento消息问题是因为它使用浏览器中的本地存储 请将magento更新至最新版本,如果错误仍然存在,请在magento_Customer/js/Customer-data.js文件中使用此修补程序 您将在供应商目录中找到此文件
vendor/magento/module-customer/view/frontend/web/js/customer-data.js
app/code/Magento/Customer/view/frontend/web/js/customer-data.js
或应用程序内目录
vendor/magento/module-customer/view/frontend/web/js/customer-data.js
app/code/Magento/Customer/view/frontend/web/js/customer-data.js
编辑此文件并更新如下代码
36 var dataProvider = {
37 getFromStorage: function (sectionNames) {
38 var result = {};
39 _.each(sectionNames, function (sectionName) {
40 if(sectionName == 'messages'){
41 return;
42 }
43 console.log(sectionName);
44 result[sectionName] = storage.get(sectionName);
45 });
46 return result;
47 },
在此之后,您需要删除静态内容并部署文件
删除静态文件的步骤
转到pub/static文件夹并删除adminhtml、frontend、_requirejs文件夹
然后在命令下面运行
php bin/magento setup:static-content:deploy
这将在pub/static文件夹中部署您的更改,您将看到您的更改
pub/static/frontend/Magento/{yourtheme}/{localeCode}/Magento_Customer/js/customer-data.js
现在你完成了
清除浏览器缓存并选中:)