mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-07-07 08:41:12 +08:00
Compare commits
No commits in common. "cfc5071a8cc1a39fc4b9a0dd9e4f69efc5a2f8b0" and "27e58472cca14c72cdc61fe37369dd3f340ffc3f" have entirely different histories.
cfc5071a8c
...
27e58472cc
@ -38,27 +38,6 @@ class Plugs extends Controller
|
||||
$this->fetch(realpath(__DIR__ . '/../../view/api/icon.html'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端脚本变量
|
||||
* @return \think\Response
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function script(): \think\Response
|
||||
{
|
||||
$debug = $this->app->isDebug() ? 'true' : 'false';
|
||||
$editor = sysconf("base.editor") ?: "ckeditor4";
|
||||
$taRoot = sysuri("admin/index/index", [], false);
|
||||
return response(join("\n", [
|
||||
"window.taDebug = {$debug};",
|
||||
"window.taAdmin = '{$taRoot}';",
|
||||
"window.taEditor = '{$editor}';",
|
||||
]))->header([
|
||||
'Content-Type' => 'application/x-javascript'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优化数据库
|
||||
* @login true
|
||||
|
||||
@ -16,7 +16,11 @@
|
||||
<link rel="stylesheet" href="__ROOT__/static/extra/style.css?at={:date('md')}">
|
||||
{block name="style"}{/block}
|
||||
<script src="__ROOT__/static/plugs/jquery/pace.min.js"></script>
|
||||
<script src="{:url('admin/api.plugs/script',[],false,false)}"></script>
|
||||
<script>
|
||||
window.taDebug = '{:intval($app->isDebug())}' > 0;
|
||||
window.taEditor = '{:sysconf("base.editor")?:"ckeditor4"}';
|
||||
window.tapiRoot = '{:sysuri("admin/index/index",[],false)}';
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="layui-layout-body layui-layout-theme-{$theme|default='default'}">
|
||||
|
||||
@ -40,7 +40,7 @@ if (typeof Array.prototype.forEach !== 'function') {
|
||||
var srcs = document.scripts[document.scripts.length - 1].src.split('/');
|
||||
window.appRoot = srcs.slice(0, -2).join('/') + '/';
|
||||
window.baseRoot = srcs.slice(0, -1).join('/') + '/';
|
||||
window.tapiRoot = window.taAdmin || window.appRoot + "admin";
|
||||
window.tapiRoot = window.tapiRoot || window.appRoot + "admin";
|
||||
|
||||
/*! 挂载 layui & jquery 对象 */
|
||||
layui.config({base: baseRoot + 'plugs/layui_exts/'});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user