This commit is contained in:
张成
2025-10-09 18:17:41 +08:00
parent 366c18bcea
commit ba61c9e45d
63 changed files with 1133 additions and 295 deletions

View File

@@ -1,12 +1,12 @@
import http from "@/utils/http";
class FileServe {
async upload_oos_img(row) {
let res = await http.postFormData("/sys_file/upload_oos_img", row);
let res = await window.framework.http.postFormData("/sys_file/upload_oos_img", row);
return res;
}
async upload_Img(row) {
let res = await http.postFormData("/file/upload_Img", row);
let res = await window.framework.http.postFormData("/file/upload_Img", row);
return res;
}
}

View File

@@ -1,27 +1,27 @@
import http from '@/utils/http'
class RolePermissionServer {
async getRoles(callback) {
let res = await http.get('/SysRolePermission/Query', {})
let res = await window.framework.httpget('/SysRolePermission/Query', {})
return res
}
async getRole(row) {
let res = await http.get('/SysRolePermission/QueryByRoleId', row)
let res = await window.framework.httpget('/SysRolePermission/QueryByRoleId', row)
return res
}
async add(row) {
let res = await http.post('/SysRolePermission/add', row)
let res = await window.framework.http.post('/SysRolePermission/add', row)
return res
}
async edit(row) {
let res = await http.post('/SysRolePermission/edit', row)
let res = await window.framework.http.post('/SysRolePermission/edit', row)
return res
}
async del(row) {
let res = await http.post('/SysRolePermission/del', row)
let res = await window.framework.http.post('/SysRolePermission/del', row)
return res
}
}

View File

@@ -1,23 +1,23 @@
import http from "@/utils/http";
class RoleServer {
async list() {
let res = await http.get("/sys_role/index", {});
let res = await window.framework.httpget("/sys_role/index", {});
return res;
}
async add(row) {
let res = await http.post("/sys_role/add", row);
let res = await window.framework.http.post("/sys_role/add", row);
return res;
}
async edit(row) {
let res = await http.post("/sys_role/edit", row);
let res = await window.framework.http.post("/sys_role/edit", row);
return res;
}
async del(row) {
let res = await http.post("/sys_role/del", row);
let res = await window.framework.http.post("/sys_role/del", row);
return res;
}
}

View File

@@ -1,12 +1,12 @@
import http from '@/utils/http'
class ShpProfitServer {
async report(param) {
let res = await http.post('/shpProfit/report', param)
let res = await window.framework.http.post('/shpProfit/report', param)
return res
}
async list(param) {
let res = await http.post('/shpProfit/list', param)
let res = await window.framework.http.post('/shpProfit/list', param)
return res
}
}

View File

@@ -1,22 +1,22 @@
import http from '@/utils/http'
class SpecificationServer {
async list() {
let res = await http.post('/specification/list', {})
let res = await window.framework.http.post('/specification/list', {})
return res
}
async add(row) {
let res = await http.post('/specification/add', row)
let res = await window.framework.http.post('/specification/add', row)
return res
}
async edit(row) {
let res = await http.post('/specification/edit', row)
let res = await window.framework.http.post('/specification/edit', row)
return res
}
async del(row) {
let res = await http.post('/specification/del', row)
let res = await window.framework.http.post('/specification/del', row)
return res
}
}

View File

@@ -1,7 +1,7 @@
import http from "@/utils/http";
class SysAddress {
async index(param) {
let res = await http.get("/sys_address/index", param);
let res = await window.framework.httpget("/sys_address/index", param);
return res;
}
}

View File

@@ -1,27 +1,27 @@
import http from "@/utils/http";
class SysModuleServer {
async all() {
let res = await http.get("/sys_menu/all", {});
let res = await window.framework.httpget("/sys_menu/all", {});
return res;
}
async list(row) {
let res = await http.get("/sys_menu/all", row);
let res = await window.framework.httpget("/sys_menu/all", row);
return res;
}
async add(row) {
let res = await http.post("/sys_menu/add", row);
let res = await window.framework.http.post("/sys_menu/add", row);
return res;
}
async edit(row) {
let res = await http.post("/sys_menu/edit", row);
let res = await window.framework.http.post("/sys_menu/edit", row);
return res;
}
async del(row) {
let res = await http.post("/sys_menu/del", row);
let res = await window.framework.http.post("/sys_menu/del", row);
return res;
}
}

View File

@@ -1,27 +1,27 @@
import http from "@/utils/http";
class SysLogServe {
async all(param) {
let res = await http.get("/sys_log/all", param);
let res = await window.framework.httpget("/sys_log/all", param);
return res;
}
async detail(param) {
let res = await http.get("/sys_log/detail", param);
let res = await window.framework.httpget("/sys_log/detail", param);
return res;
}
async delete(param) {
let res = await http.get("/sys_log/delete", param);
let res = await window.framework.httpget("/sys_log/delete", param);
return res;
}
async delete_all(param) {
let res = await http.get("/sys_log/delete_all", param);
let res = await window.framework.httpget("/sys_log/delete_all", param);
return res;
}
async operates(param) {
let res = await http.get("/sys_log/operates", param);
let res = await window.framework.httpget("/sys_log/operates", param);
return res;
}
}

View File

@@ -1,13 +1,13 @@
import http from '@/utils/http';
class systemTypeClServer {
async all(param) {
let res= await http.get('/sys_project_type/all', param);
let res= await window.framework.httpget('/sys_project_type/all', param);
return res;
}
async page(row) {
let res= await http.post('/sys_project_type/page', row);
let res= await window.framework.http.post('/sys_project_type/page', row);
return res;
}
@@ -18,17 +18,17 @@ class systemTypeClServer {
}
async add(row) {
let res= await http.post('/sys_project_type/add', row);
let res= await window.framework.http.post('/sys_project_type/add', row);
return res;
}
async edit(row) {
let res= await http.post('/sys_project_type/edit', row);
let res= await window.framework.http.post('/sys_project_type/edit', row);
return res;
}
async del(row) {
let res= await http.post('/sys_project_type/del', row);
let res= await window.framework.http.post('/sys_project_type/del', row);
return res;
}
}

View File

@@ -1,29 +1,29 @@
import http from '@/utils/http'
class TableServer {
async getAll(callback) {
return await http.get('/table/index', {})
return await window.framework.httpget('/table/index', {})
}
async add(row, callback) {
return await http.post('/table/add', row)
return await window.framework.http.post('/table/add', row)
}
async edit(row, callback) {
return await http.post('/table/edit', row, function(res) {
return await window.framework.http.post('/table/edit', row, function(res) {
callback && callback(res)
})
}
async del(row, callback) {
return await http.post('/table/del', row)
return await window.framework.http.post('/table/del', row)
}
async autoApi(id) {
return await http.get('/template/api', { id: id })
return await window.framework.httpget('/template/api', { id: id })
}
async autoDb(id) {
return await http.get('/template/autoDb', { id: id })
return await window.framework.httpget('/template/autoDb', { id: id })
}
}

View File

@@ -1,12 +1,12 @@
import http from "@/utils/http";
class UserServer {
async login(row) {
let res = await http.post("/sys_user/login", row);
let res = await window.framework.http.post("/sys_user/login", row);
return res;
}
async all() {
let res = await http.get("/sys_user/index", {});
let res = await window.framework.httpget("/sys_user/index", {});
return res;
}
@@ -16,22 +16,22 @@ class UserServer {
}
async authorityMenus() {
let res = await http.post("/sys_user/authorityMenus", {});
let res = await window.framework.http.post("/sys_user/authorityMenus", {});
return res;
}
async add(row) {
let res = await http.post("/sys_user/add", row);
let res = await window.framework.http.post("/sys_user/add", row);
return res;
}
async edit(row) {
let res = await http.post("/sys_user/edit", row);
let res = await window.framework.http.post("/sys_user/edit", row);
return res;
}
async del(row) {
let res = await http.post("/sys_user/del", row);
let res = await window.framework.http.post("/sys_user/del", row);
return res;
}
}

View File

@@ -1,27 +1,27 @@
import http from "@/utils/http";
class FormFieldServer {
async all(param) {
let res = await http.get("/sys_form_field/all", param);
let res = await window.framework.httpget("/sys_form_field/all", param);
return res;
}
async page(row) {
let res = await http.post("/sys_form_field/page", row);
let res = await window.framework.http.post("/sys_form_field/page", row);
return res;
}
async add(row) {
let res = await http.post("/sys_form_field/add", row);
let res = await window.framework.http.post("/sys_form_field/add", row);
return res;
}
async edit(row) {
let res = await http.post("/sys_form_field/edit", row);
let res = await window.framework.http.post("/sys_form_field/edit", row);
return res;
}
async del(row) {
let res = await http.post("/sys_form_field/del", row);
let res = await window.framework.http.post("/sys_form_field/del", row);
return res;
}
}

View File

@@ -1,32 +1,32 @@
import http from "@/utils/http";
class FormServer {
async all(param) {
let res = await http.get("/sys_form/all", param);
let res = await window.framework.httpget("/sys_form/all", param);
return res;
}
async page(row) {
let res = await http.post("/sys_form/page", row);
let res = await window.framework.http.post("/sys_form/page", row);
return res;
}
async generate(row) {
let res = await http.post("/sys_form/generate", row);
let res = await window.framework.http.post("/sys_form/generate", row);
return res;
}
async add(row) {
let res = await http.post("/sys_form/add", row);
let res = await window.framework.http.post("/sys_form/add", row);
return res;
}
async edit(row) {
let res = await http.post("/sys_form/edit", row);
let res = await window.framework.http.post("/sys_form/edit", row);
return res;
}
async del(row) {
let res = await http.post("/sys_form/del", row);
let res = await window.framework.http.post("/sys_form/del", row);
return res;
}
}

View File

@@ -2,46 +2,46 @@ import http from "@/utils/http";
class MenuServer {
async list(row) {
let res = await http.get("/sys_menu/index", row);
let res = await window.framework.httpget("/sys_menu/index", row);
return res;
}
async generate(row) {
let res = await http.post("/sys_menu/generate", row);
let res = await window.framework.http.post("/sys_menu/generate", row);
return res;
}
async add(row) {
let res = await http.post("/sys_menu/add", row);
let res = await window.framework.http.post("/sys_menu/add", row);
return res;
}
async edit(row) {
let res = await http.post("/sys_menu/edit", row);
let res = await window.framework.http.post("/sys_menu/edit", row);
return res;
}
async del(row) {
let res = await http.post("/sys_menu/del", row);
let res = await window.framework.http.post("/sys_menu/del", row);
return res;
}
async generate(row) {
let res = await http.post("/form/generate", row);
let res = await window.framework.http.post("/form/generate", row);
return res;
}
async generateModel(row) {
let res = await http.post("/model/generate", row);
let res = await window.framework.http.post("/model/generate", row);
return res;
}
async modelAll(row) {
let res = await http.post("/model/all", row);
let res = await window.framework.http.post("/model/all", row);
return res;
}
async modelInterface(row) {
let res = await http.post("/model/interface", row);
let res = await window.framework.http.post("/model/interface", row);
return res;
}
}

View File

@@ -1,29 +1,29 @@
import http from "@/utils/http";
class ModelFieldServer {
async all(row) {
let res = await http.get("/sys_model_field/all", row);
let res = await window.framework.httpget("/sys_model_field/all", row);
return res;
}
async allByKey(row) {
let res = await http.get("/sys_model_field/allByKey", row, {
let res = await window.framework.httpget("/sys_model_field/allByKey", row, {
hideLoad: true
});
return res;
}
async add(row) {
let res = await http.post("/sys_model_field/add", row);
let res = await window.framework.http.post("/sys_model_field/add", row);
return res;
}
async edit(row) {
let res = await http.post("/sys_model_field/edit", row);
let res = await window.framework.http.post("/sys_model_field/edit", row);
return res;
}
async del(row) {
let res = await http.post("/sys_model_field/del", row);
let res = await window.framework.http.post("/sys_model_field/del", row);
return res;
}
}

View File

@@ -1,37 +1,37 @@
import http from "@/utils/http";
class ModelServer {
async interface(row) {
let res = await http.post("/sys_model/interface", row);
let res = await window.framework.http.post("/sys_model/interface", row);
return res;
}
async all() {
let res = await http.get("/sys_model/all", {});
let res = await window.framework.httpget("/sys_model/all", {});
return res;
}
async detail(row) {
let res = await http.get("/sys_model/detail", row);
let res = await window.framework.httpget("/sys_model/detail", row);
return res;
}
async regenerate(row) {
let res = await http.post("/sys_model/regenerate", row);
let res = await window.framework.http.post("/sys_model/regenerate", row);
return res;
}
async add(row) {
let res = await http.post("/sys_model/add", row);
let res = await window.framework.http.post("/sys_model/add", row);
return res;
}
async edit(row) {
let res = await http.post("/sys_model/edit", row);
let res = await window.framework.http.post("/sys_model/edit", row);
return res;
}
async del(row) {
let res = await http.post("/sys_model/del", row);
let res = await window.framework.http.post("/sys_model/del", row);
return res;
}
}

View File

@@ -1,27 +1,27 @@
import http from "@/utils/http";
class ParamSetupServer {
async getAll() {
return await http.get("/sys_parameter/index", {});
return await window.framework.httpget("/sys_parameter/index", {});
}
async getOne(key) {
return await http.get("/sys_parameter/key", { key });
return await window.framework.httpget("/sys_parameter/key", { key });
}
async add(row) {
return await http.post("/sys_parameter/add", row);
return await window.framework.http.post("/sys_parameter/add", row);
}
async edit(row) {
return await http.post("/sys_parameter/edit", row);
return await window.framework.http.post("/sys_parameter/edit", row);
}
async setSysConfig(row) {
return await http.post("/sys_parameter/setSysConfig", row);
return await window.framework.http.post("/sys_parameter/setSysConfig", row);
}
async del(row) {
return await http.post("/sys_parameter/del", row);
return await window.framework.http.post("/sys_parameter/del", row);
}
}

View File

@@ -1,26 +1,26 @@
import http from "@/utils/http";
class SysControlTypeServer {
async all(param) {
let res = await http.get("/sys_control_type/all", param);
let res = await window.framework.httpget("/sys_control_type/all", param);
return res;
}
async page(row) {
let res = await http.post("/sys_control_type/page", row);
let res = await window.framework.http.post("/sys_control_type/page", row);
return res;
}
async add(param) {
let res = await http.post("/sys_control_type/add", param);
let res = await window.framework.http.post("/sys_control_type/add", param);
return res;
}
async edit(param) {
let res = await http.post("/sys_control_type/edit", param);
let res = await window.framework.http.post("/sys_control_type/edit", param);
return res;
}
async del(param) {
let res = await http.post("/sys_control_type/del", param);
let res = await window.framework.http.post("/sys_control_type/del", param);
return res;
}
}

View File

@@ -10,7 +10,7 @@ export default {
avatorImgPath: '',
token: getToken(),
authorityMenus: [],
menuList: []
menuList: localStorage.getItem('menuList') ? JSON.parse(localStorage.getItem('menuList')) : []
},
mutations: {
setAvator(state, avatorPath) {
@@ -30,6 +30,7 @@ export default {
},
setMenuList(state, menus) {
state.menuList = menus
localStorage.setItem('menuList', JSON.stringify(menus))
}
},
getters: {
@@ -173,6 +174,8 @@ export default {
async handleLogOut({ state, commit }, vue) {
commit('setToken', '')
commit('setAuthorityMenus', '[]')
commit('setMenuList', [])
localStorage.removeItem('menuList')
window.location.reload()
}
}

View File

@@ -72,7 +72,7 @@ class Http {
this.store.commit('user/setToken', '')
}
if (window.rootVue && window.rootVue.$router) {
window.rootVue.$router.push({ name: 'login' })
window.rootVue.$router.push({ path: '/login' }) // 使用 path 而不是 name
}
return Promise.reject(error)
}

View File

@@ -245,11 +245,12 @@ export default class uiTool {
let curRoutes = uiTool.menuToRoute(menus, ParentView, Page404)
// 合并权限路由,保留默认 home 路由
const homeRoute = mainRoute.children.find(r => r.name === 'home')
const hasHome = curRoutes.some(r => r.name === 'home')
const homeRoute = mainRoute.children.find(r => r.path === '/home')
// 检查权限路由中是否有首页(基于 path 判断)
const hasHome = curRoutes.some(r => r.path === '/home' || r.path === 'home')
if (hasHome) {
// 如果权限路由中有 home使用权限路由的 home
// 如果权限路由中有 home使用权限路由的 home(不添加默认首页)
mainRoute.children = curRoutes
} else {
// 如果权限路由中没有 home保留默认 home 并添加其他路由