mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-07-05 15:57:08 +08:00
Compare commits
3 Commits
27e58472cc
...
cfc5071a8c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfc5071a8c | ||
|
|
9422674a2b | ||
|
|
af4a1748c4 |
@ -38,6 +38,27 @@ 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,11 +16,7 @@
|
||||
<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>
|
||||
window.taDebug = '{:intval($app->isDebug())}' > 0;
|
||||
window.taEditor = '{:sysconf("base.editor")?:"ckeditor4"}';
|
||||
window.tapiRoot = '{:sysuri("admin/index/index",[],false)}';
|
||||
</script>
|
||||
<script src="{:url('admin/api.plugs/script',[],false,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.tapiRoot || window.appRoot + "admin";
|
||||
window.tapiRoot = window.taAdmin || window.appRoot + "admin";
|
||||
|
||||
/*! 挂载 layui & jquery 对象 */
|
||||
layui.config({base: baseRoot + 'plugs/layui_exts/'});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user