Does anyone know that after I added session:set() to the controller, the method failed and no error was reported? Please help me find out why. I used phpstudy to deploy the apache server!
The code is as follows:
<?phpnamespace app\index\controller;
use app\index\controller\Base;use think\Request;
use app\index\model\User as UserModel;
use think\Session;
class User extends Base{
// Login page
function login() %
Hahaha, static references need to use think/faced/session
I think it's your session::set('user_info', $user->getdata()); that is wrong. The getdata in $user->getdata() should be getData
Have you solved it?
I have the same problem
Is session enabled in your configuration?