소스 검색

测试用token,后门

lizhen_gitee 3 년 전
부모
커밋
31ae1951eb
2개의 변경된 파일5개의 추가작업 그리고 8개의 파일을 삭제
  1. 4 7
      application/common/library/Auth.php
  2. 1 1
      application/common/library/token/driver/Mysql.php

+ 4 - 7
application/common/library/Auth.php

@@ -154,13 +154,10 @@ class Auth
         if ($this->_error) {
             return false;
         }
-        if(strpos($token,'tokentestuid_') !== false){
-            $data['user_id'] = substr($token,13);
-        }else{
-            $data = Token::get($token);
-            if (!$data) {
-                return false;
-            }
+
+        $data = Token::get($token);
+        if (!$data) {
+            return false;
         }
 
         $user_id = intval($data['user_id']);

+ 1 - 1
application/common/library/token/driver/Mysql.php

@@ -68,7 +68,7 @@ class Mysql extends Driver
     public function get($token)
     {
         //方便测试
-        if(strpos($token,'estuid_') && config('app_debug') === true){
+        if(strpos($token,'testuid_') !== false && config('app_debug') === true){
             $uid = substr($token,8);
             return [
                 'user_id' => $uid,