feat:判断任务是否有学员

This commit is contained in:
lixg
2023-03-02 02:03:02 +08:00
parent 2546f61f04
commit b5beeeaa10
22 changed files with 315 additions and 75 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="projectdetails" v-if="data?.projectId">
<div class="projectdetails">
<ReturnHead
text="项目详情"
:showfile="true"
@@ -200,13 +200,6 @@
</div> -->
</div>
</div>
<div v-else>
<el-result icon="success" title="您不是此项目学员" sub-title="请联系管理员">
<template #extra>
<el-button type="primary" @click="toIndex">返回首页</el-button>
</template>
</el-result>
</div>
</template>
<script setup>
@@ -233,7 +226,21 @@ const {
const router = useRouter();
const { commit, dispatch, state } = useStore();
const data = computed(() => state.projectInfo);
useRequest(PROJECT_PROCESS, { projectId: projectId }, (e) => {
if (e.code === 6) {
console.log("eee", e);
router.push({
path: "/notpath",
});
}
});
watch(data, () => {
if (data.value.code === 6) {
router.push({
path: "/notpath",
});
}
});
onMounted(() => {
dispatch("getProjectInfo", { projectId });
});