Magento2 No key available

当年为了图方便,在安装某个Magento2的时候没有输入Encryp Key
现在升级这个Magento2的时候我留下了悔恨的眼泪。
当升级后,运行setup:upgrade的时候一直提示No key available。
我也不啰嗦了,说解决办法吧。
直接进
vendor/magento/framework/Encryption/Encryptor.php

public function hash($data, $version = self::HASH_VERSION_LATEST)
{
 //   if (empty($this->keys[$this->keyVersion])) {
 //       throw new \RuntimeException('No key available');
 //   }

    return hash_hmac($this->hashVersionMap[$version], (string)$data, false);
}

把No key available的验证干掉,修改hash方式。
目前解决了,不过不知道有没有后遗症