From f530c482284b6467c1622c662cff93f264ac67ed Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Fri, 1 Nov 2024 15:17:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/system/dictionary/dictData/components/dataPopup.vue | 2 -- .../views/system/dictionary/dictType/components/typePopup.vue | 2 -- 2 files changed, 4 deletions(-) diff --git a/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue b/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue index 09127cd..63faa99 100644 --- a/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue +++ b/frontend/src/views/system/dictionary/dictData/components/dataPopup.vue @@ -113,8 +113,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 f6364e5..7c089c8 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) { From 0e871df27bed05c4181f128c14f0c15d1d9bddb0 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Fri, 1 Nov 2024 15:27:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.env.development | 4 +- .../functionExample.ts} | 8 ++-- frontend/src/api/function/index.ts | 26 +++++++++++ frontend/src/api/function/interface/index.ts | 44 +++++++++++++++++++ frontend/src/api/resource/interface/index.ts | 27 ------------ frontend/src/api/user/login.ts | 18 +++----- .../{ResourceDialog.vue => resourcePopup.vue} | 0 7 files changed, 82 insertions(+), 45 deletions(-) rename frontend/src/api/{resource/resourceData.ts => function/functionExample.ts} (97%) create mode 100644 frontend/src/api/function/index.ts create mode 100644 frontend/src/api/function/interface/index.ts delete mode 100644 frontend/src/api/resource/interface/index.ts rename frontend/src/views/authority/resource/components/{ResourceDialog.vue => resourcePopup.vue} (100%) diff --git a/frontend/.env.development b/frontend/.env.development index d53b7f8..1573e27 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -18,5 +18,5 @@ VITE_PWA=false VITE_API_URL=/api # 开发环境跨域代理,支持配置多个 - 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.125:18092/"]]//awen +#VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]//zwen \ No newline at end of file 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 e363d15..bd2de7d 100644 --- a/frontend/src/api/user/login.ts +++ b/frontend/src/api/user/login.ts @@ -1,29 +1,25 @@ import { Login } from './interface' import { ADMIN as rePrefix } from '@/api/config/serviceName' import http from '@/api' - /** * @name 登录模块 */ // 用户登录 export const loginApi = (params: Login.ReqLoginForm) => { - return http.post(`${rePrefix}/login`, params, { loading: false }) - // return http.post(`/Register1`, params, { loading: false }) + // 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 }) + // 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 }) + // 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