有可能是 Magento 2.4 本地环境的问题,可以通过以下步骤解决:
sudo chown -R www-data:www-data /path/to/magento2
USE yourmagentodbname;
RENAME TABLE oldprefix_core_session TO newprefix_core_session;
php bin/magento cache:flush
vendor/magento/module-backend/Model/Auth.php
在该文件中找到以下代码:
$authResult->setUserType(UserContextInterface::USER_TYPE_BACKEND);
将其更改为:
$authResult->setUserType(UserContextInterface::USER_TYPE_ADMIN);
保存更改后,尝试使用新的密码重新登录 Magento 2.4 管理后台。
希望以上方法能够帮助您解决 Magento 2.4 本地环境登录问题。