cms模块添加

master
wangjiadong 4 weeks ago
parent 3a4958e1db
commit a4efa910eb
  1. 65
      jeecgboot-vue3/src/api/demo/mainHome.ts
  2. 75
      jeecgboot-vue3/src/router/helper/mainOut.ts
  3. 3
      jeecgboot-vue3/src/router/routes/index.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 }
});

@ -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);

@ -1,8 +1,7 @@
import type { AppRouteRecordRaw, AppRouteModule } from '/@/router/types'; 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 { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '/@/router/routes/basic';
import { mainOutRoutes } from './mainOut';
import { PageEnum } from '/@/enums/pageEnum'; import { PageEnum } from '/@/enums/pageEnum';
import { t } from '/@/hooks/web/useI18n'; import { t } from '/@/hooks/web/useI18n';

Loading…
Cancel
Save