diff --git a/frontend/pages/profile/profile.vue b/frontend/pages/profile/profile.vue index 29c4f92..8ce7c82 100644 --- a/frontend/pages/profile/profile.vue +++ b/frontend/pages/profile/profile.vue @@ -1190,7 +1190,17 @@ const confirmLogout = () => { // 返回上一页 const goBack = () => { - uni.navigateBack(); + // 获取页面栈 + const pages = getCurrentPages(); + if (pages.length > 1) { + // 有上一页,执行返回 + uni.navigateBack(); + } else { + // 没有上一页,跳转到square页面 + uni.reLaunch({ + url: "/pages/profile/myWorks", + }); + } }; // 打开头像修改弹窗