From e3a99a619f6ed9311517c879f871fa9936492153 Mon Sep 17 00:00:00 2001 From: significative <163999932+significative@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8D=E7=A7=B0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=AF=B9=E6=8E=A5=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BA=92=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/person.ts | 9 +- src/permissions.ts | 9 +- src/router/module/constRouter/index.ts | 10 ++ src/views/competition/index.vue | 73 +++++++-- src/views/projectName/index.vue | 174 ++++++++++++++++++++++ src/views/registrationPersonage/index.vue | 22 ++- 6 files changed, 273 insertions(+), 24 deletions(-) create mode 100644 src/views/projectName/index.vue diff --git a/src/api/person.ts b/src/api/person.ts index 7c42fa0..9abd9e8 100644 --- a/src/api/person.ts +++ b/src/api/person.ts @@ -9,7 +9,9 @@ request.interceptors.response.use(response => { enum api { liststu = '/abilityEvaluation/personalAbilityEvaluationCollect/liststu', // 个人能力评价列表 integral = '/annualScore/personalCompTotalScore/liststu', // 个人积分列表 - PAGE_XSFXBG = '/annualcompetitionprojectregistration/annualCompetitionProjectRegistration/xsfxbg', + PAGE_XSFXBG = '/annualcompetitionprojectregistration/annualCompetitionProjectRegistration/xsfxbg', // 个人能力报告 + competition = '/AnnualCompPoint/annualCompPoint/findcompp', // 比赛项目列表 + competitionOne = '/AnnualCompPoint/annualCompPoint/findcomppxq', // 比赛项目单个 } export const getlEvaluateApi = (params: Record<'pageNo' | 'pageSize', number>) => request.get(api.liststu, { params }); export const getlIntegralApi = (params: Record<'pageNo' | 'pageSize', number>) => request.get(api.integral, { params }); @@ -18,4 +20,7 @@ export const getXsfxbgApi = (params = {}) => { const par = { recreateFlag: false, annualid: '' }; Object.assign(par, params); return request.get(api.PAGE_XSFXBG, { params: par }); -}; \ No newline at end of file +}; + +export const getCompetitionApi = (id: string) => request.get(api.competition, { params: { id } }); +export const getCompetitionOneApi = (id: string) => request.get(api.competitionOne, { params: { id } }); \ No newline at end of file diff --git a/src/permissions.ts b/src/permissions.ts index 28a22d8..6ae7270 100644 --- a/src/permissions.ts +++ b/src/permissions.ts @@ -4,6 +4,8 @@ import userStore from './store/module/user' router.beforeEach(async (to, form, next) => { const useuserStore = userStore() + + if (useuserStore.token) { if (to.path === '/login') { next({ path: '/' }) @@ -12,12 +14,13 @@ router.beforeEach(async (to, form, next) => { useuserStore.getUserInfo() next() - }else{ + } else { next() } } - }else{ - next() + } else { + if (to.path === '/registrationPersonage') next({ path: '/login' }); + else next(); } }) export default router diff --git a/src/router/module/constRouter/index.ts b/src/router/module/constRouter/index.ts index a64940d..5f092e8 100644 --- a/src/router/module/constRouter/index.ts +++ b/src/router/module/constRouter/index.ts @@ -162,5 +162,15 @@ export const constRouter: any = { hidden: true, }, }, + { + path: '/projectName', + name: 'ProjectName', + component: () => import('@/views/projectName/index.vue'), + meta: { + icon: '', + title: '比赛项目名称', + hidden: true, + }, + }, ], } diff --git a/src/views/competition/index.vue b/src/views/competition/index.vue index 7d2afb9..2ef84f1 100644 --- a/src/views/competition/index.vue +++ b/src/views/competition/index.vue @@ -4,7 +4,7 @@ -
+
年度比赛名称
@@ -27,32 +27,35 @@
-