63 lines
1.5 KiB
PHP
63 lines
1.5 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
|
// +----------------------------------------------------------------------
|
|
namespace app\controller\user;
|
|
|
|
use app\model\Member;
|
|
|
|
/**
|
|
* @title 用户中心
|
|
*/
|
|
class Index extends Base {
|
|
|
|
/**
|
|
* @title 用户首页
|
|
* @return [type] [description]
|
|
*/
|
|
public function index() {
|
|
return $this->fetch();
|
|
}
|
|
|
|
/**
|
|
* @title 个人资料
|
|
* @return [type] [description]
|
|
*/
|
|
public function profile() {
|
|
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');
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @title 重置密码
|
|
* @return [type] [description]
|
|
*/
|
|
public function repasswd() {
|
|
return $this->fetch();
|
|
}
|
|
|
|
/**
|
|
* @title 上传头像
|
|
* @return [type] [description]
|
|
*/
|
|
public function avatar() {
|
|
return $this->fetch();
|
|
}
|
|
} |