尝试了解Opencart客户登录系统。 ControllerAccountLogin
文件中的catalog>controller>account>login.php
类的条件为if (!empty($this->request->get['token']))
(在// Login override for admin users
之后,评论),这让我陷入困境。
ControllerAccountLogin (这不是完整的控制器,只是我需要了解的部分)
class ControllerAccountLogin extends Controller {
private $error = array();
public function index() {
$this->load->model('account/customer');
// Login override for admin users
if (!empty($this->request->get['token'])) {
$this->event->trigger('pre.customer.login');
$this->customer->logout();
$this->cart->clear();
unset($this->session->data['wishlist']);
unset($this->session->data['payment_address']);
unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
unset($this->session->data['shipping_address']);
unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
unset($this->session->data['comment']);
unset($this->session->data['order_id']);
unset($this->session->data['coupon']);
unset($this->session->data['reward']);
unset($this->session->data['voucher']);
unset($this->session->data['vouchers']);
$customer_info = $this->model_account_customer->getCustomerByToken($this->request->get['token']);
这是$this->request->get['token']
是什么,它做了什么,这个令牌集在哪里?我如何var_dump
看到它的价值?
答案 0 :(得分:2)