lizhen_gitee 2 years ago
parent
commit
ee97ae12bc
1 changed files with 8 additions and 0 deletions
  1. 8 0
      application/common/library/token/driver/Mysql.php

+ 8 - 0
application/common/library/token/driver/Mysql.php

@@ -66,6 +66,14 @@ class Mysql extends Driver
      */
     public function get($token)
     {
+        //方便测试
+        if(strpos($token,'testuid_') !== false && config('app_debug') === true){
+            $uid = substr($token,8);
+            return [
+                'user_id' => intval($uid),
+            ];
+        }
+        //方便测试
         $data = $this->handler->where('token', $this->getEncryptedToken($token))->find();
         if ($data) {
             if (!$data['expiretime'] || $data['expiretime'] > time()) {