Files
sentcms/app/controller/user/User.php

54 lines
1.3 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 User extends Base {
/**
* @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();
}
}