This commit is contained in:
as2252258@163.com
2021-05-03 13:47:56 +08:00
parent 4686bb156a
commit bedeff5acc
+3 -11
View File
@@ -136,14 +136,9 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
} else if ($headers instanceof HttpHeaders) { } else if ($headers instanceof HttpHeaders) {
$headers = $headers->getHeaders(); $headers = $headers->getHeaders();
} }
$this->data = $headers; $this->data = $headers;
if (empty($unionId)) { if (!isset($this->data['source'])) {
throw new AuthException('您还未登录或已登录超时'); $this->data['source'] = 'browser';
}
$source = $header['source'] ?? 'browser';
if (empty($source) || !in_array($source, $this->source)) {
throw new Exception('未知的登录设备');
} }
return $this->createEncrypt($unionId); return $this->createEncrypt($unionId);
} }
@@ -177,7 +172,6 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
foreach ($caches as $cache) { foreach ($caches as $cache) {
$redis->del($cache); $redis->del($cache);
} }
return $refresh; return $refresh;
} }
@@ -279,9 +273,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
{ {
$source = $this->getSource(); $source = $this->getSource();
if (!empty($_source)) $source = $_source; if (!empty($_source)) $source = $_source;
if (empty($source)) {
throw new AuthException("未知的登陆设备");
}
return 'Tmp_Token:' . strtoupper($source) . ':' . $token; return 'Tmp_Token:' . strtoupper($source) . ':' . $token;
} }