zxhxx 3 år sedan
förälder
incheckning
ce00bfeb57
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      application/common/controller/Api.php

+ 2 - 2
application/common/controller/Api.php

@@ -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);