解决linux下文件名大小写的bug、完善用户中心

This commit is contained in:
2020-04-09 20:39:05 +08:00
parent ef993f89fa
commit f08ae0bc69
14 changed files with 280 additions and 130 deletions

View File

@@ -10,17 +10,24 @@ namespace app\controller\user;
use think\facade\View;
use think\facade\Cache;
use \app\controller\Base as BaseC;
use app\controller\Base as BaseC;
use app\model\Model;
use app\model\Form;
class Base extends BaseC {
protected function initialize() {
$url = str_replace(".", "/", strtolower($this->request->controller())) . '/' . $this->request->action();
if (!is_login() and !in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) {
$this->redirect('/admin/index/login');
$this->redirect('/user/index/login');
}
if (!in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) {
if (!in_array($url, array('user/index/login', 'user/index/logout', 'user/index/verify'))) {
$map = [];
$model = Model::where($map)->column('name, title, icon', 'name');
View::assign('model', $model);
$form = Form::where($map)->column('id, name, title', 'name');
View::assign('form', $form);
View::assign('meta_title', isset($this->data['meta_title']) ? $this->data['meta_title'] : $this->getCurrentTitle());
}
}