目的是想输入内页url时,如果未登录,则在登录后跳转到最初输入的url。
写在Common类的initialize()方法里(除了login以外,所有类继承Common)时:
1、Common类中redirect(“login/index”)->remember(),或者return redirect(“Login/index”)都出现redirect不生效,在不登录的情况下不跳转到Login/index页面,而是直接跳到目标页面;
2、Common类中$this->redirect(“login/index”)->remember();Login类中:return redirect()->restore();则报strpos() expects parameter 1 to be string, array given ;如果redirect()->restore();则不跳转到任何地址;如果$this->redirect()->restore(); 则报:Too few arguments to function
各种方法都试了,都不行。
最佳答案