-
diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php
index 59b37c06e3efba2ff042d5056f3e8086106b6331..c6385b984b90f22621c26caf327e8e8cb47d4abd 100644
--- a/application/common/controller/Backend.php
+++ b/application/common/controller/Backend.php
@@ -3,6 +3,7 @@
namespace app\common\controller;
use app\admin\library\Auth;
+use app\common\library\Fast;
use think\Config;
use think\Controller;
use think\Hook;
@@ -121,13 +122,14 @@ class Backend extends Controller
$path = str_replace('.', '/', $controllername) . '/' . $actionname;
// 定义是否Addtabs请求
- !defined('IS_ADDTABS') && define('IS_ADDTABS', input("addtabs") ? TRUE : FALSE);
+ Fast::$IS_ADDTABS = input("addtabs") ? TRUE : FALSE;
// 定义是否Dialog请求
- !defined('IS_DIALOG') && define('IS_DIALOG', input("dialog") ? TRUE : FALSE);
+ Fast::$IS_DIALOG = input("dialog") ? TRUE : FALSE;
+ $this->assign('IS_DIALOG', Fast::$IS_DIALOG);
// 定义是否AJAX请求
- !defined('IS_AJAX') && define('IS_AJAX', $this->request->isAjax());
+ Fast::$IS_AJAX = $this->request->isAjax();
$this->auth = Auth::instance();
@@ -157,7 +159,7 @@ class Backend extends Controller
}
// 非选项卡时重定向
- if (!$this->request->isPost() && !IS_AJAX && !IS_ADDTABS && !IS_DIALOG && input("ref") == 'addtabs') {
+ if (!$this->request->isPost() && !Fast::$IS_AJAX && !Fast::$IS_ADDTABS && !Fast::$IS_DIALOG && input("ref") == 'addtabs') {
$url = preg_replace_callback("/([\?|&]+)ref=addtabs(&?)/i", function ($matches) {
return $matches[2] == '&' ? $matches[1] : '';
}, $this->request->url());
diff --git a/application/common/library/Fast.php b/application/common/library/Fast.php
new file mode 100644
index 0000000000000000000000000000000000000000..b2d131b461034a2c8af7c0798a0fb9df934846c4
--- /dev/null
+++ b/application/common/library/Fast.php
@@ -0,0 +1,17 @@
+request->get('callback');
$controllername = input("controllername");
$this->loadlang($controllername);
//强制输出JSON Object
- $result = jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]);
+ $result = jsonp(Lang::get(), 200, ['Content-Type' => 'application/javascript'], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]);
return $result;
}
@@ -16,7 +16,7 @@
{:__('Control panel')}
- {if !IS_DIALOG && !$config.fastadmin.multiplenav}
+ {if !$IS_DIALOG && !$config.fastadmin.multiplenav}