Merge remote-tracking branch 'origin/master'

This commit is contained in:
caozehui
2024-11-01 15:52:18 +08:00
9 changed files with 76 additions and 42 deletions

View File

@@ -18,6 +18,7 @@ VITE_PWA=false
VITE_API_URL=/api
# 开发环境跨域代理,支持配置多个
VITE_PROXY=[["/api","http://192.168.1.122:18092/"]]
# VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]

View File

@@ -1,7 +1,6 @@
import { HomeFilled, Operation } from "@element-plus/icons-vue"
import type { Resource } from "./interface"
import type { Function } from "./interface"
const resourcedata = ref<Resource.ResResourceList[]>([
export const functionList : Function.ResFunction[] = [
{
'id': '1',
'pid':'0',
@@ -262,6 +261,5 @@ const resourcedata = ref<Resource.ResResourceList[]>([
state:0,
}]
},
])
]
export default resourcedata

View File

@@ -0,0 +1,26 @@
import http from "@/api";
import { ADMIN as rePrefix } from "@/api/config/serviceName";
import type { Function } from "@/api/function/interface";
//获取菜单列表
export const getFunctionList = (params: Function.ReqFunctionParams) => {
return http.post(`${rePrefix}/function/list`, params);
};
//添加菜单列表
export const addFunction = (params: Function.ReqFunctionParams) => {
return http.post(`${rePrefix}/function/add`,params);
};
//删除菜单列表
export const deleteFunction = (params: { id: string[] }) => {
return http.post(`${rePrefix}/function/delete`, { data: params });
};
//编辑菜单列表
export const updateFunction = (params: Function.ReqFunctionParams) => {
return http.post(`${rePrefix}/function/update`, params);
};

View File

@@ -0,0 +1,44 @@
import type { ReqPage, ResPage } from '@/api/interface'
// 菜单管理模块
export namespace Function {
/**
* 菜单管理表格分页查询参数
*/
export interface ReqFunctionParams extends ReqPage{
name?: string; // 名称
code?: string; // 编码
}
/**
* 菜单管理新增、修改、根据id查询返回的对象
*/
export interface ResFunction {
id: string;//资源表Id
pid:string;//节点0为根节点
pids?:string | null;//节点上层所有节点
name: string;//名称
code:string;//资源标识
path:string;//路径
icon?:string | null;//图标
sort:number;//排序
type:number | null;//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源
remark?: string | null;//权限资源描述
state:number;//权限资源状态
create_By?:string | null;//创建人
create_Time?:string | null;//创建时间
update_By?:string | null;//更新人
update_Time?:string | null;//更新时间
children?: ResFunction[] | null;
}
/**
* 菜单管理表格查询分页返回的对象;
*/
export interface ResFunctionPage extends ResPage<ResFunction> {
}
}

View File

@@ -1,27 +0,0 @@
import type { DefineComponent } from "vue";
import type { DatetimeFormatProps } from "vue-i18n";
// 菜单管理模块
export namespace Resource {
// 菜单列表
export interface ResResourceList {
id: string;//资源表Id
pid:string;//节点0为根节点
pids?:string;//节点上层所有节点
name: string;//名称
code:string;//资源标识
path:string;//路径
icon?:string;//图标
sort:number;//排序
type?:number;//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源
remark?: string;//权限资源描述
state:number;//权限资源状态
create_By?:string;//创建人
create_Time?:string;//创建时间
update_By?:string;//更新人
update_Time?:string;//更新时间
children?: ResResourceList[];
}
}

View File

@@ -1,7 +1,6 @@
import { Login } from './interface'
import { ADMIN as rePrefix } from '@/api/config/serviceName'
import http from '@/api'
/**
* @name 登录模块
*/
@@ -10,19 +9,16 @@ export const loginApi = (params: Login.ReqLoginForm) => {
// return http.post<Login.ResLogin>(`${rePrefix}/login`, params, { loading: false })
return http.post<Login.ResLogin>(`/Register1`, params, { loading: false })
}
// 获取菜单列表
export const getAuthMenuListApi = () => {
// return http.get<Menu.MenuOptions[]>(`${rePrefix}/menu/list`, {}, { loading: false })
return http.post<Menu.MenuOptions[]>(`/Register2`, {}, { loading: false })
}
// 获取按钮权限
export const getAuthButtonListApi = () => {
// return http.get<Login.ResAuthButtons>(`${rePrefix}/auth/buttons`, {}, { loading: false })
return http.post<Login.ResAuthButtons>(`/Register3`, {}, { loading: false })
}
// 用户退出登录
export const logoutApi = () => {
return http.post(`${rePrefix}/logout`)

View File

@@ -124,8 +124,6 @@ const save = () => {
ElMessage.success({message: `${dialogTitle.value}成功!`})
close()
await props.refreshTable!()
} else {
ElMessage.error('表单验证失败!')
}
})
} catch (err) {

View File

@@ -115,8 +115,6 @@ const save = () => {
close()
// 刷新表格
await props.refreshTable!()
} else {
ElMessage.error('表单验证失败!')
}
})
} catch (err) {