Merge branch 'develop' into feature/mzl_dev_curd
This commit is contained in:
@@ -102,7 +102,7 @@ class PermLogic
|
||||
// component 字段规则:
|
||||
// 1. 存在子菜单,固定 '/index/index'
|
||||
// 2. 否则为当前完整路径(或其它你想要的)
|
||||
$componentValue = $hasChildrenMenu ? '/index/index' : $currentPath;
|
||||
$componentValue = ($hasChildrenMenu && !$node->url && $node->type !== 'directory') ? '/index/index' : $currentPath;
|
||||
|
||||
$tree[] = [
|
||||
'id' => $node->id,
|
||||
|
||||
@@ -24,4 +24,33 @@ class UserLogic
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
public function edit(int $uid, array $data)
|
||||
{
|
||||
$user = User::find($uid);
|
||||
|
||||
if (!$user) {
|
||||
throw new BusinessException('账户不存在', 404);
|
||||
}
|
||||
|
||||
$user->fill($data);
|
||||
$user->save();
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*/
|
||||
public function savePassword(int $uid, array $data)
|
||||
{
|
||||
$password = password_hash($data['password_new'], PASSWORD_DEFAULT);
|
||||
$res = User::where('id',$uid)->update(['password' => $password]);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user