57 lines
1.2 KiB
Vue
Raw Normal View History

2025-04-30 01:43:23 +08:00
<template>
<view class="wh-full">
2025-05-16 16:16:41 +08:00
<BasicLoading
:isShow="isShow"
bgColor="#fff"
isShowTitle
textColor="#000"
title="启动中..."
:type="1"
/>
2025-04-30 01:43:23 +08:00
</view>
</template>
<script lang="ts" setup>
2025-05-18 12:53:59 +08:00
import {onLoad} from "@dcloudio/uni-app";
import {useDataStore} from "@/store/modules/data";
import {useUserStore} from "@/store/modules/user";
import {checkOpenId} from "@/api/system/login";
2025-04-30 01:43:23 +08:00
2025-05-18 11:51:50 +08:00
const { setGlobal } = useDataStore();
const { afterLoginAction } = useUserStore();
2025-05-16 16:16:41 +08:00
const isShow = ref(true);
function toHome(data: any) {
if (data.type == 1 || data.type == 2) {
uni.reLaunch({
url: "/pages/base/course-selection/notice",
});
2025-04-30 01:43:23 +08:00
} else {
uni.reLaunch({
2025-05-16 16:16:41 +08:00
url: "/pages/base/home/index",
});
}
}
onLoad(async (data: any) => {
2025-05-18 11:51:50 +08:00
console.log(data);
2025-05-16 16:16:41 +08:00
setGlobal(data);
2025-05-18 11:51:50 +08:00
if (data && data.openId) {
checkOpenId({ openId: data.openId, appCode: "JZ" })
.then(async (res) => {
if (res.resultCode == 1) {
if (res.result) {
afterLoginAction(res.result);
toHome(data);
} else {
uni.reLaunch({
2025-05-18 12:53:59 +08:00
url: "/pages/system/login/login",
2025-05-18 11:51:50 +08:00
});
2025-05-16 16:16:41 +08:00
}
2025-05-18 11:51:50 +08:00
}
})
.catch((err) => {});
2025-04-30 01:43:23 +08:00
}
2025-05-16 16:16:41 +08:00
});
2025-04-30 01:43:23 +08:00
</script>