Commit 990cab2c authored by 蔡闯's avatar 蔡闯

2021-5-26

parent 79ea795c
......@@ -11,12 +11,12 @@ class Base extends \app\BaseController
parent::__construct($app);
// if(Request::header("token")){
// $decodeData= (array)JWT::decode(Request::header('token'),config('app.jwt_key'),array("HS256"));
// $this->uid = $decodeData['uid'];
// } else {
// echo json_encode(['code'=>401,'msg'=>"token不存在!"]);exit;
// }
if(Request::header("token")){
$decodeData= (array)JWT::decode(Request::header('token'),config('app.jwt_key'),array("HS256"));
$this->uid = $decodeData['uid'];
} else {
echo json_encode(['code'=>401,'msg'=>"token不存在!"]);exit;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment