From 925d56c48a026494dec89e18e40ef189edbd8609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=96=E5=A7=90?= <2981176548@qq.com> Date: Tue, 12 Mar 2024 20:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=A1=B9=E7=9B=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HomeComponents/NavBar.vue | 2 +- src/js/request.js | 21 +++- src/router/index.js | 6 + src/views/ProjectPage/MainMessageCustom.vue | 38 ++++++ src/views/ProjectPage/ProjectCard.vue | 132 +++++++++++++++----- 5 files changed, 161 insertions(+), 38 deletions(-) create mode 100644 src/views/ProjectPage/MainMessageCustom.vue diff --git a/src/components/HomeComponents/NavBar.vue b/src/components/HomeComponents/NavBar.vue index cf8806e..ea93ac8 100644 --- a/src/components/HomeComponents/NavBar.vue +++ b/src/components/HomeComponents/NavBar.vue @@ -194,7 +194,7 @@ onMounted(() => { // avatar.value = res.data.data.avatar 数据库无头像,暂时用下面的头像 avatar.value = 'https://img1.baidu.com/it/u=2005056479,139681251&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1710176400&t=4f32b862465c709f79c8fb80d3c0444b'; console.log(username.value, avatar.value) - if (res.data.data.role === 'teacher') { + if (res.data.data.role === '老师') { console.log('这是老师'); // 执行老师相关的逻辑 role.value =true diff --git a/src/js/request.js b/src/js/request.js index 2c19191..cd0206b 100644 --- a/src/js/request.js +++ b/src/js/request.js @@ -500,8 +500,7 @@ const infoEditSettingHeaderImage = (showType, token) => { } /** - * 展示全部项目 - * @param (listAll tags isFinish) + * 展示我负责的项目 * @param token */ const projectGet =(token) => { @@ -515,8 +514,23 @@ const projectGet =(token) => { }) } - /** + * 展示游客查看的项目 + * @param data (tags isFinish) + */ +const projectGetCustom = (data) =>{ + return axios({ + url:api+ "/project/get/custom", + method: "get", + data: data, + headers:{ + 'Timestamp': getCurrentTimestamp() + } + }) +} + + + /** * 展示全部消息 * */ @@ -566,6 +580,7 @@ export default { projectGet, + projectGetCustom, diff --git a/src/router/index.js b/src/router/index.js index d24de75..99e7b5b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -136,6 +136,12 @@ const router = createRouter({ }, ] }, + { + path:'/ProjectMessage', + name:'MainMessageCustom', + component:()=>import('@/views/ProjectPage/MainMessageCustom.vue') + }, + ] }) diff --git a/src/views/ProjectPage/MainMessageCustom.vue b/src/views/ProjectPage/MainMessageCustom.vue new file mode 100644 index 0000000..7434397 --- /dev/null +++ b/src/views/ProjectPage/MainMessageCustom.vue @@ -0,0 +1,38 @@ + + diff --git a/src/views/ProjectPage/ProjectCard.vue b/src/views/ProjectPage/ProjectCard.vue index c60713e..0f71d70 100644 --- a/src/views/ProjectPage/ProjectCard.vue +++ b/src/views/ProjectPage/ProjectCard.vue @@ -1,19 +1,22 @@