From b23c4bdae147708aa33e0ca9c01bb1fdd4fcc72d Mon Sep 17 00:00:00 2001 From: JyuHsin <729757837@qq.com> Date: Wed, 26 Nov 2025 09:03:05 +0800 Subject: [PATCH] commit --- .../sys/services/impl/SysUserServiceImpl.java | 2 +- .../assets/platform/js/util/commonUtil.js | 7 +++--- .../resources/views/layouts/platform.html | 25 ++++++++++++++++--- .../views/platform/zhghh5/sys/home/todo.js | 3 ++- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/budwk/app/sys/services/impl/SysUserServiceImpl.java b/src/main/java/com/budwk/app/sys/services/impl/SysUserServiceImpl.java index d3a84a9..2bda773 100644 --- a/src/main/java/com/budwk/app/sys/services/impl/SysUserServiceImpl.java +++ b/src/main/java/com/budwk/app/sys/services/impl/SysUserServiceImpl.java @@ -308,7 +308,7 @@ public class SysUserServiceImpl extends BaseServiceImpl implements Sys String decodePwd = Base64Decoder.decodeStr(passowrd); String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt()); if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) { -// throw new BaseException("用户名或者密码不正确"); + throw new BaseException("用户名或者密码不正确"); } user = this.fetchLinks(user, "unit"); if (Lang.isNotEmpty(user.getUnit()) && StrUtil.isNotBlank(user.getUnit().getUnionId())) { diff --git a/src/main/resources/static/assets/platform/js/util/commonUtil.js b/src/main/resources/static/assets/platform/js/util/commonUtil.js index a074aef..c598b4f 100644 --- a/src/main/resources/static/assets/platform/js/util/commonUtil.js +++ b/src/main/resources/static/assets/platform/js/util/commonUtil.js @@ -327,11 +327,10 @@ function createLoading(text = '加载中...') { }) } -function getBaseSubAppPath() { - const pathname = window.location.pathname; +function getBaseSubAppPath(pathname = window.location.pathname) { const startIndex = pathname.indexOf('/platform'); if (startIndex === -1) { - throw new Error('Target path not found in URL'); + return pathname } return pathname.substring(startIndex); } @@ -341,7 +340,7 @@ function getFullSubAppPath() { const search = window.location.search; // 包含 ?appId=... const startIndex = pathname.indexOf('/platform'); if (startIndex === -1) { - throw new Error('Target path not found in URL'); + return pathname } return pathname.substring(startIndex) + search; } diff --git a/src/main/resources/views/layouts/platform.html b/src/main/resources/views/layouts/platform.html index fa9a822..c4e4444 100644 --- a/src/main/resources/views/layouts/platform.html +++ b/src/main/resources/views/layouts/platform.html @@ -309,6 +309,7 @@ layout("/layouts/v4/baseLayout.html"){ }, methods: { menuSelect(index, indexPath) { + debugger try { const app = JSON.parse(window.sessionStorage.getItem("zhgh_sub_app")) window.sessionStorage.setItem("zhgh_sub_app_left_menu_active_index-" + app.id, index) @@ -318,6 +319,7 @@ layout("/layouts/v4/baseLayout.html"){ }, // 获取菜单 getMenus(appId) { + debugger if (!appId) return this.$axios.post("/platform/sys/user/subAppMenus", {appId}).then((res) => { if (res.code === 0) { @@ -332,6 +334,7 @@ layout("/layouts/v4/baseLayout.html"){ // 设置应用信息 setAppInfo(app) { + debugger if (app) { // 储存到缓存 window.sessionStorage.setItem("zhgh_sub_app", JSON.stringify(app)) @@ -347,6 +350,7 @@ layout("/layouts/v4/baseLayout.html"){ }, // 菜单回显 echoMenus() { + debugger try { const app = JSON.parse(window.sessionStorage.getItem("zhgh_sub_app")) this.activeMenuIndex = window.sessionStorage.getItem("zhgh_sub_app_left_menu_active_index-" + app.id) @@ -367,6 +371,7 @@ layout("/layouts/v4/baseLayout.html"){ // 地址选中 hrefSelect() { + debugger function findMenuPath(menus, targetHref) { function search(items, path) { for (const item of items) { @@ -385,7 +390,7 @@ layout("/layouts/v4/baseLayout.html"){ return search(menus, []); } - const result = findMenuPath(this.menus, getBaseSubAppPath()) + const result = findMenuPath(this.menus, window.location.pathname) if(result){ this.activeMenuIndex = result[result.length-1]['id'] this.openedMenus = result.map(v=>v.id) @@ -399,6 +404,7 @@ layout("/layouts/v4/baseLayout.html"){ // 默认选中 defaultSelect() { + debugger // 查找第一个有href的子菜单 function findFirstChildWithHref(menus) { for (const menu of menus) { @@ -424,22 +430,33 @@ layout("/layouts/v4/baseLayout.html"){ } const result = findFirstChildWithHref(this.menus) + debugger if (result) { this.activeMenuIndex = result.menu.id this.openedMenus = result.parentIds this.$nextTick(() => { this.menuSelect(this.activeMenuIndex, this.openedMenus) // 使用pjax跳转 - commonUtil.pjaxPush(result.menu.href) + commonUtil.pjaxPush(getBaseSubAppPath(result.menu.href)) + + /*const tempLink = document.createElement('a') + tempLink.href = result.menu.href + tempLink.setAttribute('data-pjax', '') + tempLink.style.display = 'none' + document.body.appendChild(tempLink) + tempLink.click() + document.body.removeChild(tempLink)*/ }) } }, init() { + debugger // 页面加载时获取到正确的菜单 - const pathname = getFullSubAppPath() + const pathname = window.location.pathname if (!pathname.startsWith("/platform/v4/subApp")) { - this.$axios.post("/platform/sys/user/rootMenuByPath", {pathname}).then((res) => { + const path = getFullSubAppPath() + this.$axios.post("/platform/sys/user/rootMenuByPath", {pathname: path}).then((res) => { if (res.code === 0) { this.setAppInfo(res.data) this.getMenus(res.data?.id) diff --git a/src/main/resources/views/platform/zhghh5/sys/home/todo.js b/src/main/resources/views/platform/zhghh5/sys/home/todo.js index de2eaff..81ec40a 100644 --- a/src/main/resources/views/platform/zhghh5/sys/home/todo.js +++ b/src/main/resources/views/platform/zhghh5/sys/home/todo.js @@ -178,7 +178,8 @@ const todo = { // 处理任务 onView(task) { const {taskId, taskKey, instanceId, businessNo, formKey} = task; - + this.$toast("暂未开通从当前地址点击查看!"); + return; if (!formKey) { this.$toast("当前流程没有配置地址"); return;