--fix bug

This commit is contained in:
yuping
2023-03-31 14:37:30 +08:00
parent b0807fcd5c
commit 4ffafa732f
3 changed files with 18 additions and 8 deletions

View File

@@ -97,17 +97,13 @@ export async function request(_url, params) {
...method !== 'get' ? { data: JSON.stringify(body) } : {}
}).then(resp => resp.data).then(response => {
if (response.code !== 200 && response.code !== 0) {
console.log('window.location.', window, router)
if (response.code === 1000) {
delCookie();
(import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') ? router.push({ path: '/login', query: { returnUrl: router.currentRoute.value.fullPath } }) : window.open(window.location.protocol + import.meta.env.VITE_BASE_LOGIN_URL + encodeURIComponent(window.location.protocol + import.meta.env.VITE_BOE_BASE_URL + import.meta.env.VITE_BASE + router.currentRoute.value.fullPath), '_top')
}
if (response.code === 2001) {
router.push({ path: '/FaceTeachSignUp', query: { courseId: router.currentRoute.value.query.courseId, type: 3 } })
}
if (response.code === 2002) {
router.push({ path: '/FaceTeachNoCommon', query: { courseId: router.currentRoute.value.query.courseId, type: 3 } })
}
else if (response.code === 2001) router.push({ path: '/FaceTeachSignUp', query: { courseId: router.currentRoute.value.query.courseId, type: 3 } })
else if (response.code === 2002) router.push({ path: '/FaceTeachNoCommon', query: { courseId: router.currentRoute.value.query.courseId, type: 3 } })
else if (response.code === 9000) router.replace({ path: '/noData'})
// if (import.meta.env.DEV && response.code === 1000) {
// router.push({path: '/login'})
// } else {

View File

@@ -368,7 +368,7 @@ const {
const { data } = useRequest(STU_OFFCOURSE_DETAIL, { courseId });
const teacherInfo = useUserInfo(computed(() => data.value?.planDto?.teacherId));
const isAllowSign = computed(() => dayjs().isBetween(dayjs(data.value.planDto?.beginTime).subtract(data.value.planDto?.beforeStart || 0, "minute"), dayjs(data.value.planDto.afterStart ? data.value.planDto?.beginTime : data.value.planDto?.endTime).add(data.value.planDto.afterStart || 0, "minute")));
const isAllowSign = computed(() => dayjs().isBetween(dayjs(data.value.planDto?.beginTime).subtract(data.value.planDto?.beforeStart || 0, "minute"), dayjs(data.value.planDto?.afterStart ? data.value.planDto?.beginTime : data.value.planDto?.endTime).add(data.value.planDto?.afterStart || 0, "minute")));
const activeName = ref("first");

View File

@@ -0,0 +1,14 @@
<template>
<el-result
icon="warning"
title="该数据已经被删除或停用"
sub-title="请联系管理员"
>
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</template>
<script setup>
const toIndex = () => window.location.href = window.location.protocol + import.meta.env.VITE_BOE_HOME;
</script>