|
@@ -10,8 +10,12 @@
|
|
|
class="absolute top-0 right-0 flex h-full w-[42.5rem] items-center justify-center bg-[var(--czr-dialog-bg)]"
|
|
|
>
|
|
|
<div class="flex w-[26.5rem] flex-col">
|
|
|
- <div class="text-[1.88rem] font-bold text-[#373D4C]">xxx邀请您加入</div>
|
|
|
- <div class="mt-4 text-[1.88rem] font-bold text-[#3363DE]">xxx组织</div>
|
|
|
+ <div class="text-[1.88rem] font-bold text-[#373D4C]">
|
|
|
+ {{ state.detail.userName }}邀请您加入
|
|
|
+ </div>
|
|
|
+ <div class="mt-4 text-[1.88rem] font-bold text-[#3363DE]">
|
|
|
+ {{ state.detail.tenantName }}组织
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="__hover mt-2 mt-12 flex h-[2.5rem] w-full items-center justify-center bg-[#3363DE] text-sm text-[#ffffff]"
|
|
|
@click="onSubmit"
|
|
@@ -20,7 +24,9 @@
|
|
|
加入组织
|
|
|
</div>
|
|
|
<div class="mt-3 text-sm text-[#576275]">
|
|
|
- 链接将在 <span class="text-[#3363DE]">2025-07-31 12:22:33</span> 失效
|
|
|
+ 链接将在
|
|
|
+ <span class="text-[#3363DE]">{{ state.detail.validateTime }}</span>
|
|
|
+ 失效
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -31,25 +37,52 @@
|
|
|
import { computed, getCurrentInstance, reactive, ref, onMounted } from 'vue'
|
|
|
import { User, Lock, Clock } from '@element-plus/icons-vue'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
-import { useRouter } from 'vue-router'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
import { useAppStore } from '@/stores'
|
|
|
+import { accountLinkAccess, accountOpenLink } from '@/api/modules/global/invite'
|
|
|
|
|
|
const AppStore = useAppStore()
|
|
|
const router = useRouter()
|
|
|
+const route = useRoute()
|
|
|
const emit = defineEmits([])
|
|
|
const props = defineProps({})
|
|
|
const { proxy }: any = getCurrentInstance()
|
|
|
const state: any = reactive({
|
|
|
+ inviteCode: route.query.inviteCode,
|
|
|
loading: false,
|
|
|
+ detail: {},
|
|
|
})
|
|
|
const onSubmit = () => {
|
|
|
if (!state.loading) {
|
|
|
state.loading = true
|
|
|
- ElMessage.success('加入组织成功!')
|
|
|
- router.replace({ name: 'root' })
|
|
|
+ accountLinkAccess({
|
|
|
+ tenantId: state.detail.tenantId,
|
|
|
+ userId: AppStore.userInfo?.id,
|
|
|
+ })
|
|
|
+ .then(({ data }: any) => {
|
|
|
+ ElMessage.success('加入组织成功!')
|
|
|
+ router.replace({ name: 'root' })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ .finally(() => {})
|
|
|
+ }
|
|
|
+}
|
|
|
+const errorMsg = () => {}
|
|
|
+onMounted(() => {
|
|
|
+ initDetail()
|
|
|
+})
|
|
|
+const initDetail = () => {
|
|
|
+ if (state.inviteCode) {
|
|
|
+ accountOpenLink(state.inviteCode)
|
|
|
+ .then(({ data }: any) => {
|
|
|
+ state.detail = data
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ .finally(() => {})
|
|
|
+ } else {
|
|
|
+ errorMsg()
|
|
|
}
|
|
|
}
|
|
|
-onMounted(() => {})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|