|
@@ -113,14 +113,14 @@ class Api
|
|
|
|
|
|
// token
|
|
|
$token = $this->request->server('HTTP_TOKEN', $this->request->request('token', \think\Cookie::get('token')));
|
|
|
- @file_put_contents("token.txt",$token);
|
|
|
$path = str_replace('.', '/', $controllername) . '/' . $actionname;
|
|
|
// 设置当前请求的URI
|
|
|
$this->auth->setRequestUri($path);
|
|
|
// 检测是否需要验证登录
|
|
|
if (!$this->auth->match($this->noNeedLogin)) {
|
|
|
//初始化
|
|
|
- $this->auth->init($token);
|
|
|
+ $rs = $this->auth->init($token);
|
|
|
+ @file_put_contents("token.txt",json_encode($rs));
|
|
|
//检测是否登录
|
|
|
if (!$this->auth->isLogin()) {
|
|
|
$this->error(__('Please login first'), null, 401);
|