dggzichahu/application/admin/controller/My.php

40 lines
1.1 KiB
PHP
Executable File

<?php
// +----------------------------------------------------------------------
// | 宏驰云科技开发团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | Author: HcyShop-kiki
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\logic\MyLogic;
use yx\admin\builderClass;
class My extends AdminBase
{
/**
* 修改个人密码
* @return mixed
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function password()
{
if ($this->request->post()) {
$post = input('post.');
$post['admin_id'] = $this->admin_id;
$result = $this->validate($post, 'app\admin\validate\Password');
if ($result === true) {
MyLogic::updatePassword($post['password'], $this->admin_id);
$this->_success('修改密码成功');
}
$this->_error($result);
}
return $this->fetch();
}
}