如何在本地环境中访问“创建密码”页面?电子邮件功能未在我的本地设置,因此我无法通过浏览器访问该页面。
答案 0 :(得分:1)
您可以转到该页面: /vendor/magento/module-customer/Controller/Account/CreatePassword.php
更改execute()函数如下:
public function execute()
{
$resetPasswordToken = (string)$this->getRequest()->getParam('token');
$customerId = (int)$this->getRequest()->getParam('id');
$resultPage = $this->resultPageFactory->create();
$resultPage->getLayout()->getBlock('resetPassword')->setCustomerId($customerId)
->setResetPasswordLinkToken($resetPasswordToken);
return $resultPage;
}
现在,您可以通过添加现有客户ID直接在浏览器中访问该页面,如下所示:
<website_name>/customer/account/createPassword/?id=<customer_id>&token=8ebf7486db44b57de5cafc308c6802b4