mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 22:40:48 +00:00
Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev
This commit is contained in:
commit
af07596e1c
@ -112,7 +112,7 @@ class SystemMenusDao extends BaseDao
|
||||
* @param string $key
|
||||
* @return array
|
||||
*/
|
||||
public function column(array $where, string $field, string $key)
|
||||
public function column(array $where, string $field, string $key = '')
|
||||
{
|
||||
return $this->search($where)->column($field, $key);
|
||||
}
|
||||
|
||||
@ -228,8 +228,11 @@ class SystemMenusServices extends BaseServices
|
||||
*/
|
||||
public function delete(int $id)
|
||||
{
|
||||
if ($this->dao->count(['pid' => $id])) {
|
||||
throw new AdminException(400613);
|
||||
$ids = $this->dao->column(['pid' => $id], 'id');
|
||||
if (count($ids)) {
|
||||
foreach ($ids as $value) {
|
||||
$this->delete($value);
|
||||
}
|
||||
}
|
||||
return $this->dao->delete($id);
|
||||
}
|
||||
|
||||
@ -266,11 +266,14 @@ class SystemRouteServices extends BaseServices
|
||||
foreach ($list as $key => $value) {
|
||||
foreach ($value as $item) {
|
||||
if (!$this->diffRoute($data, $item['rule'], $item['method']) && strstr($item['rule'], '<MISS>') === false) {
|
||||
$pathAndAction = explode('/', $item['route']);
|
||||
$save[] = [
|
||||
'name' => $item['option']['real_name'] ?? $item['name'],
|
||||
'path' => $item['rule'],
|
||||
'cate_id' => $key,
|
||||
'app_name' => $app,
|
||||
'file_path' => 'app/' . $app . '/controller/' . str_replace('.', '/', $pathAndAction[0]) . '.php',
|
||||
'action' => $pathAndAction[1],
|
||||
'type' => isset($item['option']['is_common']) && $item['option']['is_common'] ? 1 : 0,
|
||||
'method' => $item['method'],
|
||||
'add_time' => date('Y-m-d H:i:s'),
|
||||
@ -305,6 +308,7 @@ class SystemRouteServices extends BaseServices
|
||||
app()->make(SystemMenusServices::class)->deleteMenu($item['path'], $item['method']);
|
||||
}
|
||||
}
|
||||
$this->cacheDriver()->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -388,7 +388,7 @@ export default {
|
||||
this.$modalSure(delfromData)
|
||||
.then((res) => {
|
||||
this.$Message.success(res.msg);
|
||||
// this.getData();
|
||||
this.getData();
|
||||
this.getMenusUnique();
|
||||
// this.$store.dispatch('menus/getMenusNavList');
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user