修改返回数据

This commit is contained in:
liaofei 2023-04-20 18:24:56 +08:00
parent c36a00df44
commit 31ad2c6e5e

View File

@ -387,6 +387,25 @@ class SystemCrud extends AuthController
['auth_type', '=', 2]
], 'methods,api_url');
$newRoute = [];
foreach ($routeList as $item) {
if ($item['methods'] == 'GET') {
if (strstr('create', $item['api_url'])) {
$key = 'create';
} else if (strstr('edit', $item['api_url'])) {
$key = 'edit';
} else {
$key = 'index';
}
} else if ($item['methods'] == 'DELETE') {
$key = 'delete';
}
if (isset($key)) {
$newRoute[$key] = $item['api_url'];
}
}
$column = $this->services->getColumnNamesList($info->table_name);
$key = 'id';
foreach ($column as $value) {
@ -406,7 +425,7 @@ class SystemCrud extends AuthController
];
}
}
$routeList = $newRoute;
return app('json')->success(compact('key', 'routeList', 'columns'));
}