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 2aee16a..b3281c2 100644 --- a/src/permissions.ts +++ b/src/permissions.ts @@ -2,7 +2,7 @@ import router from '@/router/index' import userStore from './store/module/user' // 定义要求登录访问的名单 -const asyncRouterName = ['UserInfo'] +const asyncRouterName = ['UserInfo','RegistrationPersonage','RegistrationGroup'] const asyncRouter = (path: string) => { return asyncRouterName.includes(path) @@ -10,6 +10,8 @@ const asyncRouter = (path: string) => { router.beforeEach(async (to, form, next) => { const useuserStore = userStore() + + if (useuserStore.token) { if (to.path === '/login') { next({ path: '/' }) 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 @@
-