perf: 优化鉴权和跳转模板

This commit is contained in:
Ying
2023-08-02 18:17:48 +08:00
parent b1623b2f3e
commit 295adfbd04
2 changed files with 17 additions and 20 deletions

View File

@@ -44,7 +44,6 @@ body{font-family: '微软雅黑',serif; color: #CCC; font-size: 16px;background:
</div>
</body>
<!-- 公共js部分 -->
<script type="text/javascript">
let wait = document.getElementById('wait'),
href = document.getElementById('href').href,
@@ -52,20 +51,18 @@ body{font-family: '微软雅黑',serif; color: #CCC; font-size: 16px;background:
let interval = setInterval(function(){
let time = --wait.innerHTML;
if(time <= 0) {
if (window.top !== window.self) {
let host = window.location.host;
let protocol = window.location.protocol;
let domain = href.replace(protocol+ '//', '').replace('/', '').replace(/(^\s*)|(\s*$)/g, "");
if (window.top !== window.self && host === domain) {
let id = window.frameElement.getAttribute('id');
parent.layui.layer.close(id);
}
if ('_parent' === target) {
parent.location.href = href;
} else {
location.href = href;
}
}
else {
if ('_parent' === target) {
parent.location.href = href;
} else {
location.href = href;
}
}
clearInterval(interval);
}
}, 1000);

View File

@@ -11,7 +11,7 @@ use Webman\Http\Response;
use Webman\Http\Request;
/**
* 管理员权限
* 前端权限
* @package app\admin\middleware\system
* @author meystack <
*/
@@ -64,7 +64,7 @@ class IndexPermissions implements MiddlewareInterface
// 是否验证登录器
$userInfo = UserTokenService::isLogin();
if (!empty($userInfo)) {
if (!empty($userInfo) && isset($userInfo['id'])) {
if (in_array($action, $this->repeatLogin)) {
return redirect($this->JumpUrl);
}