更新目录结构
This commit is contained in:
@@ -9,8 +9,23 @@
|
||||
namespace app\controller;
|
||||
|
||||
use app\BaseController;
|
||||
use think\facade\Cache;
|
||||
use app\services\system\DictionaryService;
|
||||
|
||||
class Base extends BaseController{
|
||||
|
||||
public $data = ['code' => 1, 'data' => '', 'message' => ''];
|
||||
|
||||
public function initialize(){
|
||||
$this->cacheData($this->request); //缓存基础数据
|
||||
}
|
||||
|
||||
protected function cacheData($request) {
|
||||
$diction = Cache::get('diction');
|
||||
if(!$diction){
|
||||
$service = app()->make(DictionaryService::class);
|
||||
$data = $service->getDictionaryAll();
|
||||
Cache::set('diction', $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user