作者 王晓刚
1 个管道 的构建 通过 耗费 1 秒

修改问题文档

... ... @@ -4,6 +4,7 @@ namespace app\admin\controller;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use app\common\library\Token;
use think\Config;
use think\Db;
use think\Hook;
... ... @@ -108,8 +109,8 @@ class Index extends Backend
$this->view->assign('title', __('Login'));
Hook::listen("admin_login_init", $this->request);
$token = cookie('token');
dump($token);
$user = cookie('user');
dump($user);
if(!empty($token)){
$user_id = Db::name('user_token')->where(['token'=>$token])->value('user_id');
dump($user_id);
... ...
... ... @@ -141,6 +141,7 @@ class User extends Frontend
$token = $this->auth->getToken();
session('token',$token);
Cookie::set('token',$token);
session('user',$result);
$this->success('SUCCESS','',['target_url'=>rawurldecode($target_url)]);
}
... ... @@ -193,6 +194,7 @@ class User extends Frontend
$token = $this->auth->getToken();
session('token',$token);
Cookie::set('token',$token);
session('user',$result1);
$this->success('SUCCESS');
}
... ...