41 lines
1022 B
PHP
Executable File
41 lines
1022 B
PHP
Executable File
<?php
|
|
namespace app\user\controller;
|
|
|
|
use app\user\model\Setting as SettingModel;
|
|
use app\user\model\User as UserModel;
|
|
use think\facade\View;
|
|
|
|
/**
|
|
* 用户管理
|
|
*/
|
|
class Setting extends Controller
|
|
{
|
|
/**
|
|
* 账号信息
|
|
*/
|
|
public function user()
|
|
{
|
|
$model = UserModel::get($this->user_id);
|
|
$login = SettingModel::getItem('passport',0)['login'];
|
|
if (!$this->request->isAjax()) {
|
|
$time = time();
|
|
return View::fetch('user',compact('model','login','time'));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 修改管理员密码
|
|
*/
|
|
public function renew()
|
|
{
|
|
$model = UserModel::get($this->user_id);
|
|
if (!$this->request->isAjax()) {
|
|
return View::fetch('renew',compact('model'));
|
|
}
|
|
if ($model->renew($this->postData('data'))) {
|
|
return $this->renderSuccess('修改成功');
|
|
}
|
|
return $this->renderError($model->getError() ?: '修改失败');
|
|
}
|
|
}
|