refactor:从服务端限制WEB终端仅限超管执行命令

This commit is contained in:
妙码生花 2023-08-01 21:57:36 +08:00
parent 479df6b864
commit 02321bf726

View File

@ -187,8 +187,8 @@ class Terminal
$token = request()->server('HTTP_BATOKEN', request()->request('batoken', Cookie::get('batoken') ?: false));
$auth = Auth::instance();
$auth->init($token);
if (!$auth->isLogin()) {
$this->execError('Please login first', true);
if (!$auth->isSuperAdmin()) {
$this->execError("You're not super administrator", true);
}
}