1
0
Files
2020-08-06 14:58:51 +08:00

70 lines
2.0 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\system\controller;
use app\common\service\Member as MemberService;
use app\common\service\Menu as MenuService;
use think\Request;
class Index extends _Init
{
/**
* 后台首页
* @return [type] [description]
*/
public function index()
{
$this->user = MemberService::info(UID);
$this->menu = MenuService::show(UID);
return $this->fetch();
}
/**
* 个人信息
* @param Request $request 提交的信息 用户名
* @return [type] [description]
*/
public function info(Request $request)
{
if (IS_POST) {
$data = $request->post();
if (MemberService::editInfo(UID, $data, 'nickname') === true) {
return $this->success();
} else {
return $this->error(MemberService::getError());
}
} else {
$this->assign('info', MemberService::info(UID));
return $this->fetch();
}
}
/**
* 修改密码
* @param Request $request 数据集
* @return [type] [description]
*/
public function password(Request $request)
{
if (IS_POST) {
$old = $request->post('oldpass');
$new = $request->post('newpass');
$repass = $request->post('repass');
$result = MemberService::changePassword(UID, $old, $new, $repass);
return $this->back($result);
} else {
return $this->fetch();
}
}
public function main()
{
return $this->fetch();
}
}