From 12dd698d08ffb53d226932f4500bc1bf668db302 Mon Sep 17 00:00:00 2001 From: zerosaturation Date: Mon, 15 Jun 2026 14:27:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=9B=9E=E9=80=80=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/pages/profile/profile.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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", + }); + } }; // 打开头像修改弹窗