1、修复几处bug;

2、完善内容管理中的细节功能
This commit is contained in:
2020-04-03 17:14:49 +08:00
parent 743d429bb8
commit 2f4386f196
12 changed files with 72 additions and 52 deletions

View File

@@ -150,9 +150,8 @@ class User extends Base {
* @author colin <colin@tensent.cn>
*/
private function getUserinfo($uid = null, $pass = null, $errormsg = null) {
$uid = $uid ? $uid : input('id');
//如果无UID则修改当前用户
$uid = $uid ? $uid : session('user_auth.uid');
$uid = $uid ? $uid : $this->request->param('uid', session('userInfo.uid'));
$map['uid'] = $uid;
if ($pass != null) {
unset($map);

View File

@@ -14,6 +14,16 @@ use \app\controller\Base as BaseC;
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');
}
if (!in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) {
}
}
protected function fetch($template = '') {
$config = Cache::get('system_config_data');
$this->tpl_config['view_depr'] = '_';
@@ -29,6 +39,15 @@ class Base extends BaseC {
if ($template == '') {
$template = str_replace(".", "@", strtolower($this->request->controller())) . "/" . $this->request->action();
}
$template_path = str_replace("public", "", $this->tpl_config['view_dir_name']);
$this->tpl_config['tpl_replace_string'] = [
'__static__' => '/static',
'__img__' => $template_path . 'static/images',
'__css__' => $template_path . 'static/css',
'__js__' => $template_path . 'static/js',
'__plugins__' => '/static/plugins',
'__public__' => $template_path . 'static',
];
View::config($this->tpl_config);
View::assign($this->data);