1
0
Fork 0

update QueryLogServiceProvider

main
panliang 2024-08-25 15:21:30 +08:00
parent 0e7a40ff61
commit 17150cf734
2 changed files with 25 additions and 2 deletions

View File

@ -17,7 +17,7 @@
监听sql执行, 打印日志
- `app/Providers/QueryLogServiceProvider.php`
- `bootstrap\providers.php`
- `bootstrap/providers.php`
### 无限级分类
@ -28,3 +28,26 @@
| parent_id | 上级id | 默认: 0 |
| path | 所有上级id | 默认: -, 例如: -1-2-3- |
| sort | 排序 | 正序 |
### 修改组件鉴权 `permission` 方法
- `vendor\slowlyo\owl-admin\src\Renderers\BaseRenderer.php`
```php
public function filteredResults()
{
$permissionKey = 'owl_permission';
// if (key_exists($permissionKey, $this->amisSchema)) {
// if (!admin_user()->can($this->amisSchema[$permissionKey])) {
// return data_get($this->amisSchema, 'owl_permission_replace_value', '');
// }
// }
if (key_exists($permissionKey, $this->amisSchema)) {
$this->amisSchema['visible'] = admin_user()->can($this->amisSchema[$permissionKey]);
}
return \Slowlyo\OwlAdmin\Support\Cores\AdminPipeline::handle(static::class, $this->amisSchema);
}
```

View File

@ -61,7 +61,7 @@ class QueryLogServiceProvider extends ServiceProvider
$sql = vsprintf($sql, array_map([$query->connection->getPdo(), 'quote'], $bindings));
}
return sprintf('[%s] %s', $this->formatDuration($query->time), $sql);
return sprintf('[%s] [%s] %s', request()->fullUrl(), $this->formatDuration($query->time), $sql);
}
/**