Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何直接在Magento2中查看创建密码页面?_Magento2 - Fatal编程技术网

如何直接在Magento2中查看创建密码页面?

如何直接在Magento2中查看创建密码页面?,magento2,Magento2,如何在本地环境中访问“创建密码”页面?“我的本地”中未设置电子邮件功能,因此我无法通过浏览器访问该页面。您可以转到该页面: /供应商/magento/module customer/Controller/Account/CreatePassword.php 更改执行功能如下: public function execute() { $resetPasswordToken = (string)$this->getRequest()->getParam('toke

如何在本地环境中访问“创建密码”页面?“我的本地”中未设置电子邮件功能,因此我无法通过浏览器访问该页面。

您可以转到该页面: /供应商/magento/module customer/Controller/Account/CreatePassword.php

更改执行功能如下:

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;


    }
<website_name>/customer/account/createPassword/?id=<customer_id>&token=8ebf7486db44b57de5cafc308c6802b4
现在,通过添加现有客户id直接在浏览器中访问页面,如下所示:

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;


    }
<website_name>/customer/account/createPassword/?id=<customer_id>&token=8ebf7486db44b57de5cafc308c6802b4