From c83eadcbedc90f2b49fc282752fef5dd5743e14d Mon Sep 17 00:00:00 2001 From: dkp Date: Fri, 20 Jun 2025 18:16:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(layout):=20=E6=B7=BB=E5=8A=A0=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E9=82=80=E8=AF=B7=E7=A0=81=E5=8A=A0=E5=85=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 Basic.vue 中添加 JoinModal 组件,用于展示加入企业的模态框 - 添加 checkHasInviteCode 方法,在页面加载时检查邀请码 - 新增 getQueryParam 工具函数,用于获取 URL 参数 - 添加加入企业的相关 API 接口 - 实现 JoinModal 组件,包含加入企业的逻辑和界面 --- src/api/all/index.ts | 10 ++++++++ src/components/join-modal.vue | 47 +++++++++++++++++++++++++++++++++++ src/layouts/Basic.vue | 15 ++++++++++- src/utils/helper.ts | 5 ++++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 src/components/join-modal.vue create mode 100644 src/utils/helper.ts diff --git a/src/api/all/index.ts b/src/api/all/index.ts index 3d60f5e..6f0b095 100644 --- a/src/api/all/index.ts +++ b/src/api/all/index.ts @@ -150,3 +150,13 @@ export const removeEnterpriseAccount = (userId: number) => { export const getEnterpriseInviteCode = () => { return Http.get(`/v1/enterprises/invite-code`); }; + +// 根据邀请码获取企业信息 +export const getEnterpriseByInviteCode = (inviteCode: string) => { + return Http.get(`/v1/enterprises/by-invite-code`, { invite_code: inviteCode }); +}; + +// 根据邀请码加入企业 +export const joinEnterpriseByInviteCode = (inviteCode: string) => { + return Http.post(`/v1/enterprises/join`, { invite_code: inviteCode }); +}; diff --git a/src/components/join-modal.vue b/src/components/join-modal.vue new file mode 100644 index 0000000..9d2ebfd --- /dev/null +++ b/src/components/join-modal.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/layouts/Basic.vue b/src/layouts/Basic.vue index 8123734..565347c 100644 --- a/src/layouts/Basic.vue +++ b/src/layouts/Basic.vue @@ -1,7 +1,11 @@