diff --git a/.workbuddy/expert-history.json b/.workbuddy/expert-history.json index 64baa52..decac99 100644 --- a/.workbuddy/expert-history.json +++ b/.workbuddy/expert-history.json @@ -24,5 +24,5 @@ } ] }, - "lastUpdated": 1775909724804 + "lastUpdated": 1775910071224 } \ No newline at end of file diff --git a/src/passport/invite/index.tsx b/src/passport/invite/index.tsx index d4eaaba..6acb211 100644 --- a/src/passport/invite/index.tsx +++ b/src/passport/invite/index.tsx @@ -171,7 +171,27 @@ const InvitePage: React.FC = () => { }, 1500); } else { console.error('接受邀请失败:', res.data.message, 'code:', res.data.code); - Taro.showToast({ title: res.data.message || '加入失败', icon: 'none' }); + const errorMsg = res.data.message || ''; + + // 用户不存在,引导去登录注册 + if (errorMsg.includes('用户不存在') || errorMsg.includes('用户创建失败') || errorMsg.includes('请先登录')) { + Taro.showModal({ + title: '需要登录', + content: '您尚未注册,请先完成登录或注册后再加入应用', + confirmText: '去登录', + cancelText: '取消', + success: (modalRes) => { + if (modalRes.confirm) { + // 跳转到登录页面,携带token参数以便登录后返回 + Taro.navigateTo({ + url: `/passport/login/index?redirect=${encodeURIComponent('/passport/invite/index?token=' + token)}` + }); + } + } + }); + } else { + Taro.showToast({ title: errorMsg || '加入失败', icon: 'none' }); + } } } catch (err: any) { console.error('接受邀请异常:', err);