fix init check
This commit is contained in:
parent
7f90d22fb4
commit
8f31483f9e
2 changed files with 10 additions and 9 deletions
|
@ -28,14 +28,14 @@ class Backend extends dcNsProcess
|
||||||
{
|
{
|
||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
self::$init = defined('DC_CONTEXT_ADMIN');
|
static::$init = defined('DC_CONTEXT_ADMIN');
|
||||||
|
|
||||||
return self::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function process(): bool
|
public static function process(): bool
|
||||||
{
|
{
|
||||||
if (!self::$init) {
|
if (!static::$init) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,17 +29,14 @@ class Manage extends dcNsProcess
|
||||||
{
|
{
|
||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
if (defined('DC_CONTEXT_ADMIN')) {
|
static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin();
|
||||||
dcPage::checkSuper();
|
|
||||||
self::$init = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return self::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function process(): bool
|
public static function process(): bool
|
||||||
{
|
{
|
||||||
if (!self::$init) {
|
if (!static::$init) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +80,10 @@ class Manage extends dcNsProcess
|
||||||
|
|
||||||
public static function render(): void
|
public static function render(): void
|
||||||
{
|
{
|
||||||
|
if (!static::$init) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dcPage::openModule(
|
dcPage::openModule(
|
||||||
__('Pings'),
|
__('Pings'),
|
||||||
dcPage::jsJson('dclog_list', [
|
dcPage::jsJson('dclog_list', [
|
||||||
|
|
Loading…
Reference in a new issue