ykt-team-wxapp/pages/login/redirect-page.vue
2026-01-29 11:42:56 +08:00

77 lines
1.8 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) => {
const href =
typeof options.q === "string" ? decodeURIComponent(options.q) : "";
const [, url = ""] = href.split("?");
const data = url.split("&").reduce((acc, cur) => {
console.log(cur);
const [key, value] = cur.split("=");
console.log(key, "=====", value);
acc[key] = value;
return acc;
}, {});
changeTeam(data);
});
</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>