error(mb_convert_encoding($e->getMessage(), 'UTF-8', 'UTF-8,GBK,GB2312,BIG5')); } $this->auth = Auth::instance(); $routePath = $this->controllerPath . '/' . $this->request->action(true); $token = $this->request->server('HTTP_BATOKEN', $this->request->request('batoken', Cookie::get('batoken') ?: false)); if (!$this->auth->actionInArr($this->noNeedLogin)) { $this->auth->init($token); if (!$this->auth->isLogin()) { $this->error(__('Please login first'), [ 'routeName' => 'adminLogin' ], 302); } if (!$this->auth->actionInArr($this->noNeedPermission)) { if (!$this->auth->check($routePath)) { $this->error(__('You have no permission'), [ 'routeName' => 'admin' ], 302); } } } else { if ($token) { $this->auth->init($token); } } } public function queryBuilder() { $quickSearch = $this->request->get("quick_search/s", ''); $page = $this->request->get("page/d", 1); $limit = $this->request->get("limit/d", 10); $where = []; $alias = []; if (!empty($this->model)) { $tableName = $this->model->getTable(); $alias[$tableName] = $tableName; } // print_r($alias); // 构建好where等返回 } }