Преглед на файлове

用户端和师傅端,单点登录

lizhen_gitee преди 1 месец
родител
ревизия
b58dec78bb
променени са 2 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 2 0
      application/common/library/Auth.php
  2. 2 0
      application/common/library/Authworker.php

+ 2 - 0
application/common/library/Auth.php

@@ -320,6 +320,8 @@ class Auth
                 $this->_user = $user;
 
                 $this->_token = Random::uuid();
+
+                Token::clear($user->id);//清空Token,单点登录
                 Token::set($this->_token, $user->id, $this->keeptime);
 
                 $this->_logined = true;

+ 2 - 0
application/common/library/Authworker.php

@@ -363,6 +363,8 @@ class Authworker
                 $this->_user = $user;
 
                 $this->_token = Random::uuid();
+
+                Tokenworker::clear($user->id);//清空Token,单点登录
                 Tokenworker::set($this->_token, $user->id, $this->keeptime);
 
                 $this->_logined = true;