84 lines
2.2 KiB
Vue
Raw Normal View History

2025-04-22 10:22:33 +08:00
<template>
<view class="wh-full">
2025-05-13 15:39:44 +08:00
<BasicLoading
:isShow="isShow"
bgColor="#fff"
isShowTitle
textColor="#000"
title="启动中..."
:type="1"
/>
2025-04-22 10:22:33 +08:00
</view>
</template>
<script lang="ts" setup>
2025-05-13 15:39:44 +08:00
import { onLoad } from "@dcloudio/uni-app";
import { useDataStore } from "@/store/modules/data";
import { useUserStore } from "@/store/modules/user";
import { checkOpenId, findJsByPhoneApi } from "@/api/system/login";
2025-04-22 10:22:33 +08:00
2025-05-13 15:39:44 +08:00
const { setGlobal } = useDataStore();
const { afterLoginAction } = useUserStore();
const { setFile, getFile } = useDataStore();
const isShow = ref(true);
2025-05-21 02:44:13 +08:00
function toHome(data: any) {
if (data.type == 1) {
uni.reLaunch({
url: "/pages/base/groupTeaching/zhujiao",
2025-05-13 15:39:44 +08:00
});
2025-04-22 10:22:33 +08:00
} else {
2025-05-21 02:44:13 +08:00
uni.switchTab({
url: "/pages/base/message/index",
2025-05-13 15:39:44 +08:00
});
}
}
onLoad(async (data: any) => {
if (data && data.openId) {
setGlobal(data);
2025-05-21 02:44:13 +08:00
checkOpenId({
openId: data.openId,
appCode: data.type == 1 ? "ZB" : "JS",
})
2025-05-13 15:39:44 +08:00
.then(async (res) => {
if (res.resultCode == 1) {
if (res.result) {
afterLoginAction(res.result);
2025-05-21 02:44:13 +08:00
if (data.type == 1) {
toHome(data);
} else {
const findJsByPhoneResult = await findJsByPhoneApi({
phone: res.result.telephone,
});
if (findJsByPhoneResult.resultCode == 1) {
if (findJsByPhoneResult.result) {
if (findJsByPhoneResult.result["confirmStatus"] == "A") {
toHome(data);
} else {
setFile({
...findJsByPhoneResult.result,
...getFile,
2025-05-13 15:39:44 +08:00
});
2025-05-21 02:44:13 +08:00
setTimeout(() => {
uni.reLaunch({
url: "/pages/view/hr/teacherProfile/index",
});
}, 1500);
}
} else {
toHome(data);
2025-05-13 15:39:44 +08:00
}
}
}
} else {
uni.reLaunch({
url: "/pages/system/login/login",
});
}
}
})
.catch((err) => {});
2025-04-22 10:22:33 +08:00
}
2025-05-13 15:39:44 +08:00
});
2025-04-22 10:22:33 +08:00
</script>