database
This commit is contained in:
@@ -50,7 +50,7 @@ class Frontend
|
|||||||
$this->auth = Auth::instance();
|
$this->auth = Auth::instance();
|
||||||
$token = request()->header('token');
|
$token = request()->header('token');
|
||||||
if ($token) {
|
if ($token) {
|
||||||
if(request()->controller != 'app\czg\app\controller\LoginController' && request()->action != 'index'){} {
|
if(!strstr(request()->controller, 'LoginController') && request()->action != 'index') {
|
||||||
if(!$this->auth->init($token)) {
|
if(!$this->auth->init($token)) {
|
||||||
$this->error('Token expiration', [], 401);
|
$this->error('Token expiration', [], 401);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,14 +18,12 @@ class HelpWordController extends Frontend
|
|||||||
$this->error('参数不完整');
|
$this->error('参数不完整');
|
||||||
}
|
}
|
||||||
$word = new HelpClassify;
|
$word = new HelpClassify;
|
||||||
$word->connect(Config('think-orm.search_library'));
|
$result = Db::connect(config('think-orm.search_library'))->name('help_classify')
|
||||||
$result = $word
|
|
||||||
->with('helpword')
|
|
||||||
->where('types', $get['types'])->select()->toArray();
|
->where('types', $get['types'])->select()->toArray();
|
||||||
$result = convertToCamelCase($result);
|
$result = convertToCamelCase($result);
|
||||||
foreach ($result as $k => $v) {
|
foreach ($result as $k => $v) {
|
||||||
$result[$k]['helpWordList'] = convertToCamelCase($v['helpword']);
|
$result[$k]['helpWordList'] = Db::connect(config('think-orm.search_library'))->name('help_word')
|
||||||
unset($result[$k]['helpword']);
|
->where('help_classify_id', $v['helpClassifyId'])->select()->toArray();
|
||||||
}
|
}
|
||||||
$this->success('ok', $result);
|
$this->success('ok', $result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user