Update Plugs.php

This commit is contained in:
邹景立 2022-11-21 12:45:48 +08:00
parent 6cbb687862
commit 294c8b82a6

View File

@ -47,13 +47,10 @@ class Plugs extends Controller
*/ */
public function script(): \think\Response public function script(): \think\Response
{ {
$taDebug = $this->app->isDebug() ? 'true' : 'false'; return response(join("\r\n", [
$taAdmin = sysuri('admin/index/index', [], false); sprintf("window.taDebug = %s;", $this->app->isDebug() ? 'true' : 'false'),
$taEditor = sysconf('base.editor') ?: 'ckeditor4'; sprintf("window.taAdmin = '%s';", sysuri('admin/index/index', [], false)),
return response(join("\n", [ sprintf("window.taEditor = '%s';", sysconf('base.editor') ?: 'ckeditor4'),
"window.taDebug = {$taDebug};",
"window.taAdmin = '{$taAdmin}';",
"window.taEditor = '{$taEditor}';",
]))->contentType('application/x-javascript'); ]))->contentType('application/x-javascript');
} }