1
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import http from '@/utils/http'
|
||||
class RolePermissionServer {
|
||||
async getRoles(callback) {
|
||||
let res = await window.framework.httpget('/SysRolePermission/Query', {})
|
||||
let res = await window.framework.http.get('/SysRolePermission/Query', {})
|
||||
return res
|
||||
}
|
||||
|
||||
async getRole(row) {
|
||||
let res = await window.framework.httpget('/SysRolePermission/QueryByRoleId', row)
|
||||
let res = await window.framework.http.get('/SysRolePermission/QueryByRoleId', row)
|
||||
return res
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import http from "@/utils/http";
|
||||
class RoleServer {
|
||||
async list() {
|
||||
let res = await window.framework.httpget("/sys_role/index", {});
|
||||
let res = await window.framework.http.get("/sys_role/index", {});
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import http from "@/utils/http";
|
||||
class SysAddress {
|
||||
async index(param) {
|
||||
let res = await window.framework.httpget("/sys_address/index", param);
|
||||
let res = await window.framework.http.get("/sys_address/index", param);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import http from "@/utils/http";
|
||||
class SysModuleServer {
|
||||
async all() {
|
||||
let res = await window.framework.httpget("/sys_menu/all", {});
|
||||
let res = await window.framework.http.get("/sys_menu/all", {});
|
||||
return res;
|
||||
}
|
||||
|
||||
async list(row) {
|
||||
let res = await window.framework.httpget("/sys_menu/all", row);
|
||||
let res = await window.framework.http.get("/sys_menu/all", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
import http from "@/utils/http";
|
||||
class SysLogServe {
|
||||
async all(param) {
|
||||
let res = await window.framework.httpget("/sys_log/all", param);
|
||||
let res = await window.framework.http.get("/sys_log/all", param);
|
||||
return res;
|
||||
}
|
||||
|
||||
async detail(param) {
|
||||
let res = await window.framework.httpget("/sys_log/detail", param);
|
||||
let res = await window.framework.http.get("/sys_log/detail", param);
|
||||
return res;
|
||||
}
|
||||
|
||||
async delete(param) {
|
||||
let res = await window.framework.httpget("/sys_log/delete", param);
|
||||
let res = await window.framework.http.get("/sys_log/delete", param);
|
||||
return res;
|
||||
}
|
||||
|
||||
async delete_all(param) {
|
||||
let res = await window.framework.httpget("/sys_log/delete_all", param);
|
||||
let res = await window.framework.http.get("/sys_log/delete_all", param);
|
||||
return res;
|
||||
}
|
||||
|
||||
async operates(param) {
|
||||
let res = await window.framework.httpget("/sys_log/operates", param);
|
||||
let res = await window.framework.http.get("/sys_log/operates", param);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import http from '@/utils/http';
|
||||
class systemTypeClServer {
|
||||
async all(param) {
|
||||
let res= await window.framework.httpget('/sys_project_type/all', param);
|
||||
let res= await window.framework.http.get('/sys_project_type/all', param);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import http from '@/utils/http'
|
||||
class TableServer {
|
||||
async getAll(callback) {
|
||||
return await window.framework.httpget('/table/index', {})
|
||||
return await window.framework.http.get('/table/index', {})
|
||||
}
|
||||
|
||||
async add(row, callback) {
|
||||
@@ -19,11 +19,11 @@ class TableServer {
|
||||
}
|
||||
|
||||
async autoApi(id) {
|
||||
return await window.framework.httpget('/template/api', { id: id })
|
||||
return await window.framework.http.get('/template/api', { id: id })
|
||||
}
|
||||
|
||||
async autoDb(id) {
|
||||
return await window.framework.httpget('/template/autoDb', { id: id })
|
||||
return await window.framework.http.get('/template/autoDb', { id: id })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class UserServer {
|
||||
}
|
||||
|
||||
async all() {
|
||||
let res = await window.framework.httpget("/sys_user/index", {});
|
||||
let res = await window.framework.http.get("/sys_user/index", {});
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import http from "@/utils/http";
|
||||
class FormFieldServer {
|
||||
async all(param) {
|
||||
let res = await window.framework.httpget("/sys_form_field/all", param);
|
||||
let res = await window.framework.http.get("/sys_form_field/all", param);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import http from "@/utils/http";
|
||||
class FormServer {
|
||||
async all(param) {
|
||||
let res = await window.framework.httpget("/sys_form/all", param);
|
||||
let res = await window.framework.http.get("/sys_form/all", param);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import http from "@/utils/http";
|
||||
|
||||
class MenuServer {
|
||||
async list(row) {
|
||||
let res = await window.framework.httpget("/sys_menu/index", row);
|
||||
let res = await window.framework.http.get("/sys_menu/index", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import http from "@/utils/http";
|
||||
class ModelFieldServer {
|
||||
async all(row) {
|
||||
let res = await window.framework.httpget("/sys_model_field/all", row);
|
||||
let res = await window.framework.http.get("/sys_model_field/all", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
async allByKey(row) {
|
||||
let res = await window.framework.httpget("/sys_model_field/allByKey", row, {
|
||||
let res = await window.framework.http.get("/sys_model_field/allByKey", row, {
|
||||
hideLoad: true
|
||||
});
|
||||
return res;
|
||||
|
||||
@@ -6,12 +6,12 @@ class ModelServer {
|
||||
}
|
||||
|
||||
async all() {
|
||||
let res = await window.framework.httpget("/sys_model/all", {});
|
||||
let res = await window.framework.http.get("/sys_model/all", {});
|
||||
return res;
|
||||
}
|
||||
|
||||
async detail(row) {
|
||||
let res = await window.framework.httpget("/sys_model/detail", row);
|
||||
let res = await window.framework.http.get("/sys_model/detail", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import http from "@/utils/http";
|
||||
class ParamSetupServer {
|
||||
async getAll() {
|
||||
return await window.framework.httpget("/sys_parameter/index", {});
|
||||
return await window.framework.http.get("/sys_parameter/index", {});
|
||||
}
|
||||
|
||||
async getOne(key) {
|
||||
return await window.framework.httpget("/sys_parameter/key", { key });
|
||||
return await window.framework.http.get("/sys_parameter/key", { key });
|
||||
}
|
||||
|
||||
async add(row) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import http from "@/utils/http";
|
||||
class SysControlTypeServer {
|
||||
async all(param) {
|
||||
let res = await window.framework.httpget("/sys_control_type/all", param);
|
||||
let res = await window.framework.http.get("/sys_control_type/all", param);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -244,10 +244,27 @@ export default class uiTool {
|
||||
let menus = uiTool.transformTree(authorityMenus)
|
||||
let curRoutes = uiTool.menuToRoute(menus, ParentView, Page404)
|
||||
|
||||
// 合并权限路由,保留默认 home 路由
|
||||
// 递归检查所有层级中是否有首页路由
|
||||
const hasHomeInRoutes = (routes) => {
|
||||
if (!routes || !Array.isArray(routes)) return false
|
||||
|
||||
for (let route of routes) {
|
||||
// 检查当前路由的 path
|
||||
if (route.path === '/home' || route.path === 'home') {
|
||||
return true
|
||||
}
|
||||
// 递归检查子路由
|
||||
if (route.children && route.children.length > 0) {
|
||||
if (hasHomeInRoutes(route.children)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const homeRoute = mainRoute.children.find(r => r.path === '/home')
|
||||
// 检查权限路由中是否有首页(基于 path 判断)
|
||||
const hasHome = curRoutes.some(r => r.path === '/home' || r.path === 'home')
|
||||
const hasHome = hasHomeInRoutes(curRoutes)
|
||||
|
||||
if (hasHome) {
|
||||
// 如果权限路由中有 home,使用权限路由的 home(不添加默认首页)
|
||||
|
||||
Reference in New Issue
Block a user