81 lines
1.7 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-06-20 09:51:43 +08:00
function goByJs(js: any) {
console.log(js);
// if (js.jsType == "助教") {
// uni.reLaunch({
// url: "/pages/base/groupTeaching/zhujiao",
// });
// } else {
if (js.confirmStatus == "A") {
uni.switchTab({
url: "/pages/base/message/index",
});
} else {
setFile({
...js,
...getFile,
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/view/hr/teacherProfile/index",
});
}, 1500);
}
// }
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,
2025-06-20 09:51:43 +08:00
appCode: "JS",
2025-05-21 02:44:13 +08:00
})
2025-06-20 09:51:43 +08:00
.then(async (res: any) => {
2025-05-13 15:39:44 +08:00
if (res.resultCode == 1) {
if (res.result) {
afterLoginAction(res.result);
2025-06-20 09:51:43 +08:00
// 跳转页面
goByJs(res.result.js)
return;
2025-05-13 15:39:44 +08:00
}
}
uni.reLaunch({
url: "/pages/system/login/login",
});
2025-05-13 15:39:44 +08:00
})
.catch((err) => {
uni.reLaunch({
url: "/pages/system/login/login"
})
});
2025-06-20 09:51:43 +08:00
} else {
uni.reLaunch({
url: "/pages/system/login/login"
})
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>