ykt-wxapp/pages/login/redirect-page.vue
2026-01-19 18:52:18 +08:00

66 lines
1.5 KiB
Vue

<template>
<view class="flex flex-col justify-center items-center h-full">
<image class="flash-logo" src="/static/logo-plain.png" />
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import api from '@/utils/api';
import { set } from "@/utils/cache";
import { toast } from '@/utils/widget';
const teamId = ref('');
const corpId = ref('');
const loading = ref(false);
const team = ref(null)
async function changeTeam({ teamId, corpId, corpName }) {
loading.value = true;
const res = await api('getTeamData', { teamId, corpId, withCorpName: true });
loading.value = false;
if (res && res.data) {
team.value = res.data;
team.value.corpName = corpName;
set('invite-team-info', {
corpId: team.value.corpId,
teamId: team.value.teamId,
corpName: team.value.corpName,
teamName: team.value.name,
avatars: team.value && Array.isArray(team.value.memberList) ? team.value.memberList.map(item => item.avatar || '') : [],
})
uni.redirectTo({
url: '/pages/login/login?source=teamInvite'
})
} else {
toast(res?.message || '获取团队信息失败')
}
}
onLoad(options => {
teamId.value = options.teamId || '';
corpId.value = options.corpId || '';
changeTeam({ teamId: teamId.value, corpId: corpId.value });
})
</script>
<style>
.flash-logo {
width: 200rpx;
height: 200rpx;
animation: flash 2.5s infinite;
}
@keyframes flash {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>