add:新增用户信息编辑
This commit is contained in:
parent
bae186d82a
commit
4f0c37d281
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CatchAdmin [Just Like ~ ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: JaguarJack [ njphper@gmail.com ]
|
||||
// +----------------------------------------------------------------------
|
@ -243,4 +243,16 @@ class User extends CatchController
|
||||
{
|
||||
return CatchResponse::success($excel->save($userExport, Utils::publicPath('export/users')));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新个人信息
|
||||
*
|
||||
* @time 2020年09月20日
|
||||
* @param Request $request
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function profile(Request $request)
|
||||
{
|
||||
return CatchResponse::success($this->user->updateBy($request->user()->id, $request->param()));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CatchAdmin [Just Like ~ ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: JaguarJack [ njphper@gmail.com ]
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class AddUserAvatar extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change()
|
||||
{
|
||||
if ($this->hasTable('users')) {
|
||||
$table = $this->table('users');
|
||||
|
||||
$table->addColumn('avatar', 'string', [
|
||||
'limit' => 255,
|
||||
'default' => '',
|
||||
'comment' => '用户头像',
|
||||
'after' => 'email'])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@ class Users extends CatchModel
|
||||
'username', // 用户名
|
||||
'password', // 用户密码
|
||||
'email', // 邮箱 登录
|
||||
'avatar', // 头像
|
||||
'creator_id', // 创建者ID
|
||||
'department_id', // 部门ID
|
||||
'status', // 用户状态 1 正常 2 禁用
|
||||
|
@ -21,6 +21,7 @@ $router->group(function () use ($router){
|
||||
// 切换状态
|
||||
$router->put('users/switch/status/<id>', '\catchAdmin\permissions\controller\User@switchStatus');
|
||||
$router->put('users/recover/<id>', '\catchAdmin\permissions\controller\User@recover');
|
||||
$router->put('users/profile', '\catchAdmin\permissions\controller\User@profile');
|
||||
$router->get('users/get/roles', '\catchAdmin\permissions\controller\User@getRoles');
|
||||
$router->get('user/info', '\catchAdmin\permissions\controller\User@info');
|
||||
$router->get('user/export', '\catchAdmin\permissions\controller\User@export');
|
||||
|
Loading…
x
Reference in New Issue
Block a user