diff --git a/frontend/.env.development b/frontend/.env.development index e4424ec..403fe95 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -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/"]] \ No newline at end of file +# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]] diff --git a/frontend/src/api/resource/resourceData.ts b/frontend/src/api/function/functionExample.ts similarity index 97% rename from frontend/src/api/resource/resourceData.ts rename to frontend/src/api/function/functionExample.ts index d3683bc..f872cfe 100644 --- a/frontend/src/api/resource/resourceData.ts +++ b/frontend/src/api/function/functionExample.ts @@ -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([ +export const functionList : Function.ResFunction[] = [ { 'id': '1', 'pid':'0', @@ -262,6 +261,5 @@ const resourcedata = ref([ state:0, }] }, -]) +] -export default resourcedata \ No newline at end of file diff --git a/frontend/src/api/function/index.ts b/frontend/src/api/function/index.ts new file mode 100644 index 0000000..bfb12eb --- /dev/null +++ b/frontend/src/api/function/index.ts @@ -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); + }; + + + diff --git a/frontend/src/api/function/interface/index.ts b/frontend/src/api/function/interface/index.ts new file mode 100644 index 0000000..11374cb --- /dev/null +++ b/frontend/src/api/function/interface/index.ts @@ -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 { + + } +} \ No newline at end of file diff --git a/frontend/src/api/resource/interface/index.ts b/frontend/src/api/resource/interface/index.ts deleted file mode 100644 index e59c64b..0000000 --- a/frontend/src/api/resource/interface/index.ts +++ /dev/null @@ -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[]; - } - - -} \ No newline at end of file diff --git a/frontend/src/api/user/login.ts b/frontend/src/api/user/login.ts index 3583e5a..bd2de7d 100644 --- a/frontend/src/api/user/login.ts +++ b/frontend/src/api/user/login.ts @@ -1,7 +1,6 @@ import { Login } from './interface' import { ADMIN as rePrefix } from '@/api/config/serviceName' import http from '@/api' - /** * @name 登录模块 */ @@ -10,20 +9,17 @@ export const loginApi = (params: Login.ReqLoginForm) => { // return http.post(`${rePrefix}/login`, params, { loading: false }) return http.post(`/Register1`, params, { loading: false }) } - // 获取菜单列表 export const getAuthMenuListApi = () => { // return http.get(`${rePrefix}/menu/list`, {}, { loading: false }) return http.post(`/Register2`, {}, { loading: false }) } - // 获取按钮权限 export const getAuthButtonListApi = () => { // return http.get(`${rePrefix}/auth/buttons`, {}, { loading: false }) return http.post(`/Register3`, {}, { loading: false }) } - // 用户退出登录 export const logoutApi = () => { return http.post(`${rePrefix}/logout`) -} +} \ No newline at end of file diff --git a/frontend/src/views/authority/resource/components/ResourceDialog.vue b/frontend/src/views/authority/resource/components/resourcePopup.vue similarity index 100% rename from frontend/src/views/authority/resource/components/ResourceDialog.vue rename to frontend/src/views/authority/resource/components/resourcePopup.vue diff --git a/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue b/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue index 130992b..3327fe4 100644 --- a/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue +++ b/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue @@ -124,8 +124,6 @@ const save = () => { ElMessage.success({message: `${dialogTitle.value}成功!`}) close() await props.refreshTable!() - } else { - ElMessage.error('表单验证失败!') } }) } catch (err) { diff --git a/frontend/src/views/system/dictionary/dictType/components/typePopup.vue b/frontend/src/views/system/dictionary/dictType/components/typePopup.vue index f906539..38b7daf 100644 --- a/frontend/src/views/system/dictionary/dictType/components/typePopup.vue +++ b/frontend/src/views/system/dictionary/dictType/components/typePopup.vue @@ -115,8 +115,6 @@ const save = () => { close() // 刷新表格 await props.refreshTable!() - } else { - ElMessage.error('表单验证失败!') } }) } catch (err) {