更新
This commit is contained in:
@@ -11,6 +11,9 @@ namespace app\controller\auth;
|
||||
use app\controller\Base;
|
||||
use app\services\auth\AuthService;
|
||||
use app\services\SocialiteService;
|
||||
use app\model\Member;
|
||||
use app\model\auth\Users;
|
||||
use app\model\auth\RolesAccess;
|
||||
|
||||
class Index extends Base{
|
||||
|
||||
@@ -25,6 +28,19 @@ class Index extends Base{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function member(){
|
||||
// $map = [];
|
||||
// $member = Member::where($map)->select();
|
||||
// $save = [];
|
||||
// foreach($member as $item){
|
||||
// $user = Users::where('username', '=', $item->username)->findOrEmpty();
|
||||
// if($user->isEmpty()){
|
||||
// $save[] = ['uid' => $item['uid'], 'username' => $item['username'], 'password' => '123456', 'nickname' => $item['nickname'], 'email' => $item['email'], 'department_id' => $item['department']];
|
||||
// }
|
||||
// }
|
||||
// (new Users())->saveAll($save);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 第三方账号登录
|
||||
*/
|
||||
|
||||
@@ -27,6 +27,24 @@ class Role extends Base{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 角色修改
|
||||
* @time 2019年12月11日
|
||||
* @param $id
|
||||
* @param Request $request
|
||||
* @return Array
|
||||
*/
|
||||
public function edit(RoleService $service) {
|
||||
try {
|
||||
$service->updateRole($this->request);
|
||||
$this->data['code'] = 1;
|
||||
} catch (\Exception $e) {
|
||||
$this->data['code'] = 0;
|
||||
$this->data['message'] = $e->getMessage();
|
||||
}
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 角色授权
|
||||
* @time 2019年12月11日
|
||||
|
||||
@@ -48,6 +48,25 @@ class User extends Base{
|
||||
$res = app()->make(UsersService::class)->updateUsers($this->request);
|
||||
$this->data['code'] = 1;
|
||||
$this->data['data'] = $res;
|
||||
$this->data['message'] = "更新成功!";
|
||||
} catch (\Exception $e) {
|
||||
$this->data['code'] = 0;
|
||||
$this->data['message'] = $e->getMessage();
|
||||
}
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 修改密码
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function passwd(){
|
||||
try {
|
||||
$res = app()->make(UsersService::class)->updateUserPassword($this->request);
|
||||
$this->data['code'] = 1;
|
||||
$this->data['data'] = $res;
|
||||
$this->data['message'] = "修改成功";
|
||||
} catch (\Exception $e) {
|
||||
$this->data['code'] = 0;
|
||||
$this->data['message'] = $e->getMessage();
|
||||
@@ -70,6 +89,7 @@ class User extends Base{
|
||||
}
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 用户信息
|
||||
* @param int $uid
|
||||
@@ -89,8 +109,7 @@ class User extends Base{
|
||||
try {
|
||||
$uid = $this->request->param('uid');
|
||||
$role = $this->request->param('role');
|
||||
$manage_class = $this->request->param('manage_class');
|
||||
app()->make(UsersService::class)->updateRoles($uid, $role, $manage_class);
|
||||
app()->make(UsersService::class)->updateRoles($uid, $role);
|
||||
$this->data['message'] = '更新成功!';
|
||||
} catch (\Exception $e) {
|
||||
$this->data['code'] = 0;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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\system;
|
||||
|
||||
use app\controller\Base;
|
||||
use app\services\system\DictionaryService;
|
||||
|
||||
/**
|
||||
* @title 文件
|
||||
*/
|
||||
class File extends Base{
|
||||
|
||||
}
|
||||
@@ -27,4 +27,16 @@ class Log extends Base {
|
||||
$this->data['data'] = $list;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 我的日志
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function my(){
|
||||
$list = app()->make(UsersLogService::class)->getMyLogList($this->request);
|
||||
|
||||
$this->data['data'] = $list;
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
@@ -126,10 +126,9 @@ class Menu extends Base{
|
||||
* @title 我的菜单
|
||||
* @return Array
|
||||
*/
|
||||
public function my(){
|
||||
$menu = app()->make(AuthService::class)->getAuthMenu();
|
||||
public function my(AuthService $service){
|
||||
$this->data['code'] = 1;
|
||||
$this->data['data'] = ['menu' => $menu, 'permissions' => []];
|
||||
$this->data['data'] = ['menu' => $service->getAuthMenu($this->request), 'permissions' => $service->getAuthPermissions($this->request)];
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user