From a4efa910ebadea820d93c11a6f01ca65464b8c37 Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Mon, 28 Oct 2024 15:22:07 +0800 Subject: [PATCH] =?UTF-8?q?cms=E6=A8=A1=E5=9D=97=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecgboot-vue3/src/api/demo/mainHome.ts | 65 ++++++++++++++++++ jeecgboot-vue3/src/router/helper/mainOut.ts | 75 +++++++++++++++++++++ jeecgboot-vue3/src/router/routes/index.ts | 3 +- 3 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 jeecgboot-vue3/src/api/demo/mainHome.ts create mode 100644 jeecgboot-vue3/src/router/helper/mainOut.ts diff --git a/jeecgboot-vue3/src/api/demo/mainHome.ts b/jeecgboot-vue3/src/api/demo/mainHome.ts new file mode 100644 index 0000000..2b16e95 --- /dev/null +++ b/jeecgboot-vue3/src/api/demo/mainHome.ts @@ -0,0 +1,65 @@ +import { defHttp } from '/@/utils/http/axios'; + +enum Api { + DEMO_NAV_LIST = '/cms/front/getColumnList', + DEMO_ARTICLE_LIST = '/cms/front/getArticleListByColumn', + DEMO_ARTICLE_ITEM = '/cms/front/getByArticleTitle', + getindexcomp = '/cms/front/getindexcomp', + getindexnews = '/cms/front/getindexnew', + getindexaward = '/cms/front/getindexaward', +} + +/** + * @description: 获取导航 + */ + +export const demoNavListApi = () => + defHttp.get({ + url: Api.DEMO_NAV_LIST, + }); + + /** + * 获取文章列表 + * @returns + */ +export const demoArticleListApi = (params:any) => + defHttp.get({ + url: Api.DEMO_ARTICLE_LIST, + params + }); + + +/** + * 获取首页的新闻 + * @returns + */ +export const getindexnews = (params:any) => + defHttp.get({ + url: Api.getindexnews, + params + }); + +export const getindexcomp = (params:any) => + defHttp.get({ + url: Api.getindexcomp, + params + }); + +export const getindexaward = (params:any) => + defHttp.get({ + url: Api.getindexaward, + params + }); + + + /** + * 获取文章 + * @returns + */ +export const demoArticleApi = (id:string) => + defHttp.get({ + url: Api.DEMO_ARTICLE_ITEM, + params:{ id } + }); + + diff --git a/jeecgboot-vue3/src/router/helper/mainOut.ts b/jeecgboot-vue3/src/router/helper/mainOut.ts new file mode 100644 index 0000000..27b62fc --- /dev/null +++ b/jeecgboot-vue3/src/router/helper/mainOut.ts @@ -0,0 +1,75 @@ +/** +The routing of this file will not show the layout. +It is an independent new page. +the contents of the file still need to log in to access + */ +import type { AppRouteModule } from '/@/router/types'; + +// test +// http:ip:port/main-out +export const mainOutRoutes: AppRouteModule[] = [ + { + path: '/main-out', + name: 'MainOut', + component: () => import('/@/views/demo/main-out/index.vue'), + meta: { + title: 'MainOut', + ignoreAuth: true, + }, + }, + // ====== + { + path: '/main-home', + name: 'MainOut', + component: () => import('/@/views/demo/main-home/index.vue'), + meta: { + title: 'MainHome', + ignoreAuth: true, + }, + redirect: '/main-home/HomePage', + children: [ + { + path: '/main-home/HomePage', + name: 'HomePage', + component: () => import('/@/views/demo/main-home/components/homePage/index.vue'), + meta: { + title: 'HomePage', + ignoreAuth: true, + }, + }, + { + path: '/main-home/MatchEvaluation', + name: 'MatchEvaluation', + component: () => import('/@/views/demo/main-home/components/matchEvaluation/index.vue'), + meta: { + title: 'MatchEvaluation', + ignoreAuth: true, + }, + redirect: '/main-home/MatchEvaluation/MCh', + children: [ + { + path: '/main-home/MatchEvaluation/MCh', + name: 'MCh', + component: () => import('/@/views/demo/main-home/components/matchEvaluation/components/MCh.vue'), + meta: { + title: 'MCh', + ignoreAuth: true, + }, + }, + { + path: '/main-home/MatchEvaluation/LesserCh/:id', + name: 'LesserCh', + component: () => import('/@/views/demo/main-home/components/matchEvaluation/components/LesserCh.vue'), + meta: { + title: 'LesserCh', + ignoreAuth: true, + }, + }, + ] + }, + + ], + } +]; + +export const mainOutRouteNames = mainOutRoutes.map((item) => item.name); diff --git a/jeecgboot-vue3/src/router/routes/index.ts b/jeecgboot-vue3/src/router/routes/index.ts index 3b70793..8412d1f 100644 --- a/jeecgboot-vue3/src/router/routes/index.ts +++ b/jeecgboot-vue3/src/router/routes/index.ts @@ -1,8 +1,7 @@ import type { AppRouteRecordRaw, AppRouteModule } from '/@/router/types'; - +import {mainOutRoutes} from '@/router/helper/mainOut' import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '/@/router/routes/basic'; -import { mainOutRoutes } from './mainOut'; import { PageEnum } from '/@/enums/pageEnum'; import { t } from '/@/hooks/web/useI18n';