前端用户中心功能完善
This commit is contained in:
@@ -21,6 +21,7 @@ class Base extends BaseC {
|
||||
}
|
||||
|
||||
if (!in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) {
|
||||
View::assign('meta_title', isset($this->data['meta_title']) ? $this->data['meta_title'] : $this->getCurrentTitle());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +37,9 @@ class Base extends BaseC {
|
||||
$this->tpl_config['view_dir_name'] = 'public' . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $pc_themes;
|
||||
}
|
||||
}
|
||||
if(!is_dir($this->app->getRootPath() . $this->tpl_config['view_dir_name'])){
|
||||
$this->tpl_config['view_dir_name'] = 'public' . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default';
|
||||
}
|
||||
if ($template == '') {
|
||||
$template = str_replace(".", "@", strtolower($this->request->controller())) . "/" . $this->request->action();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\user;
|
||||
|
||||
use app\model\Member;
|
||||
|
||||
/**
|
||||
* @title 用户中心
|
||||
*/
|
||||
@@ -26,7 +28,21 @@ class Index extends Base {
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function profile() {
|
||||
return $this->fetch();
|
||||
if ($this->request->isPost()) {
|
||||
$reuslt = (new Member())->editUser($this->request, session('userInfo.uid'));
|
||||
if (false !== $reuslt) {
|
||||
return $this->success('修改成功!');
|
||||
} else {
|
||||
return $this->error('修改失败');
|
||||
}
|
||||
}else{
|
||||
$info = Member::find(session('userInfo.uid'));
|
||||
$this->data = [
|
||||
'info' => $info,
|
||||
'keyList' => Member::$useredit
|
||||
];
|
||||
return $this->fetch('user@/edit');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user