5
Magento 2:如何从数据库中重置客户密码
它是数据库中客户密码的哈希值。因此,MD5和Sha1无法正常工作。 UPDATE `customer_entity` SET `password` = MD5('test123') WHERE `email` = 'X@X.com'; 那么如何使用数据库查询来更新密码。可能是MD5(Sha1('test123'))吗? Magento如何通过代码进行操作。去vendor\magento\module-customer\Console\Command\UpgradeHashAlgorithmCommand.php protected function execute(InputInterface $input, OutputInterface $output) { $this->collection = $this->customerCollectionFactory->create(); $this->collection->addAttributeToSelect('*'); $customerCollection = $this->collection->getItems(); /** @var $customer Customer */ foreach ($customerCollection as $customer) { $customer->load($customer->getId()); if (!$this->encryptor->validateHashVersion($customer->getPasswordHash())) { list($hash, $salt, $version) = explode(Encryptor::DELIMITER, $customer->getPasswordHash(), 3); $version .= …