Переглянути джерело

修复前台无法调用插件显示页面的问题。

magicblack 4 роки тому
батько
коміт
b59b2ba7e9

+ 1 - 1
addons/adminloginbg/controller/Index.php

@@ -9,7 +9,7 @@ class Index extends Controller
 
     public function index()
     {
-        $this->error("当前插件暂无前台页面");
+        exit("当前插件暂无前台页面");
     }
 
 }

+ 1 - 1
application/extra/version.php

@@ -3,7 +3,7 @@ return array (
     'name' => '苹果CMS内容管理系统',
     'copyright' => 'MacCMS',
     'url' => '//github.com/magicblack',
-    'code' => '2020.1000.1066',
+    'code' => '2020.1000.1067',
     'license' => '免费版',
 );
 ?>

+ 1 - 57
vendor/karsonzhang/fastadmin-addons/src/addons/Controller.php

@@ -2,7 +2,6 @@
 
 namespace think\addons;
 
-use app\common\library\Auth;
 use think\Config;
 use think\Hook;
 use think\Lang;
@@ -25,7 +24,7 @@ class Controller extends \think\Controller
 
     /**
      * 无需登录的方法,同时也就不需要鉴权了
-     * @var array
+     * @var arrayAuth
      */
     protected $noNeedLogin = ['*'];
 
@@ -112,61 +111,6 @@ class Controller extends \think\Controller
         // 设置替换字符串
         $cdnurl = Config::get('site.cdnurl');
         $this->view->replace('__ADDON__', $cdnurl . "/assets/addons/" . $this->addon);
-
-        $this->auth = Auth::instance();
-        // token
-        $token = $this->request->server('HTTP_TOKEN', $this->request->request('token', \think\Cookie::get('token')));
-
-        $path = 'addons/' . $this->addon . '/' . str_replace('.', '/', $this->controller) . '/' . $this->action;
-        // 设置当前请求的URI
-        $this->auth->setRequestUri($path);
-        // 检测是否需要验证登录
-        if (!$this->auth->match($this->noNeedLogin))
-        {
-            //初始化
-            $this->auth->init($token);
-            //检测是否登录
-            if (!$this->auth->isLogin())
-            {
-                $this->error(__('Please login first'), 'index/user/login');
-            }
-            // 判断是否需要验证权限
-            if (!$this->auth->match($this->noNeedRight))
-            {
-                // 判断控制器和方法判断是否有对应权限
-                if (!$this->auth->check($path))
-                {
-                    $this->error(__('You have no permission'));
-                }
-            }
-        }
-        else
-        {
-            // 如果有传递token才验证是否登录状态
-            if ($token)
-            {
-                $this->auth->init($token);
-            }
-        }
-
-        // 如果有使用模板布局
-        if ($this->layout)
-        {
-            $this->view->engine->layout('layout/' . $this->layout);
-        }
-
-        $this->view->assign('user', $this->auth->getUser());
-
-        $site = Config::get("site");
-
-        $upload = \app\common\model\Config::upload();
-
-        // 上传信息配置后
-        Hook::listen("upload_config_init", $upload);
-        Config::set('upload', array_merge(Config::get('upload'), $upload));
-
-        // 加载当前控制器语言包
-        $this->assign('site', $site);
     }
 
     /**