diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php b/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php index e00e5e15d..331888b5b 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemMenus.php @@ -256,13 +256,12 @@ class SystemMenus extends AuthController public function ruleList() { //获取所有的路由 - $ruleList = app()->make(SystemRouteServices::class)->selectList(['app_name' => 'adminapi'], 'name,path,method,type,id'); + $ruleList = app()->make(SystemRouteServices::class)->selectList(['app_name' => 'adminapi'], 'name,path,method,type,id')->toArray(); $menuApiList = $this->services->getColumn(['auth_type' => 2, 'is_del' => 0], "concat(`api_url`,'_',lower(`methods`)) as rule"); if ($menuApiList) $menuApiList = array_column($menuApiList, 'rule'); $list = []; foreach ($ruleList as $item) { - $item['path'] = str_replace('adminapi/', '', $item['path']); - if (!in_array($item['path'] . '_' . $item['method'], $menuApiList)) { + if (!in_array($item['path'] . '_' . strtolower($item['method']), $menuApiList)) { $item['real_name'] = $item['name'] ?? ''; $item['method'] = strtoupper($item['method']); $list[] = $item; diff --git a/crmeb/app/services/system/SystemCrudServices.php b/crmeb/app/services/system/SystemCrudServices.php index cbd4106ec..986a71b0b 100644 --- a/crmeb/app/services/system/SystemCrudServices.php +++ b/crmeb/app/services/system/SystemCrudServices.php @@ -65,12 +65,39 @@ class SystemCrudServices extends BaseServices return compact('list', 'count'); } + /** + * 数据库字段类型 + * @author 等风来 + * @email 136327134@qq.com + * @date 2023/4/11 + * @return \string[][] + */ public function getTabelRule() { - $adapter = app()->make(MysqlAdapter::class); return [ - 'types' => $adapter->getColumnTypes(), - ]; + 'types' => [ + 'string', + 'char', + 'text', + 'integer', + 'biginteger', + 'float', + 'decimal', + 'datetime', + 'timestamp', + 'time', + 'date', + 'blob', + 'binary', + 'varbinary', + 'boolean', + 'uuid', + // Geospatial data types + 'geometry', + 'point', + 'linestring', + 'polygon', + ]; } /** diff --git a/template/admin/src/pages/setting/systemMenus/index.vue b/template/admin/src/pages/setting/systemMenus/index.vue index 8664f1e13..d7cea3c79 100644 --- a/template/admin/src/pages/setting/systemMenus/index.vue +++ b/template/admin/src/pages/setting/systemMenus/index.vue @@ -114,8 +114,8 @@ - - + +
接口名称:{{ item.real_name }}
请求方式:{{ item.method }}
-
接口地址:{{ item.rule }}
+
接口地址:{{ item.path }}
@@ -250,6 +250,10 @@ export default { // 获取权限列表 getRuleList() { getRuleList().then((res) => { + this.foundationList = []; + this.openList = []; + this.seletRouteIds = []; + this.seletRoute = []; res.data.map((e) => { if (e.type) { this.foundationList.push(e);