Update Plugs.php

This commit is contained in:
邹景立 2022-07-11 23:35:02 +08:00
parent 150e1f16bf
commit ab4845c28c

View File

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