TP6框架--CRMEB学习笔记:布置后台管理框架+配置路由
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助

最近在研究一个基于TP6的框架CRMEB,这里分享下我的开发心得
首先在上篇文章中,我们安装了CRMEBphp接口项目,需要可以看这一篇
TP6框架--CRMEB学习笔记:项目初始化+环境配置
1.获取项目
这里是git地址
https://gitee.com/ZhongBangKeJi/CRMEB-Min.git
下载后用WebStorm打开

2.依赖安装+项目运行
先打开终端,运行
npm install
全局安装依赖
然后在代码上修改后台接口地址,改为上篇中安装好的后台接口地址

然后根据运行文件

运行以下代码运行项目
npm run serve

打开网站看效果

登录成功后的效果

3.创建路由
现在,给大家说说创建新页面,新路由的过程,首先,打开设置,点击管理权限,打开权限规则,我们要先新建一个规则

设置好参数

打开代码,先创建好文件夹和文件

再去router中创建test文件

内容如下,可做参考:
import BasicLayout from '@/components/main'
const pre = 'test_'
export default {
path: '/admin/test',
name: 'test',
header: 'test',
redirect: {
name: `${pre}wechatMenus`
},
meta: {
auth: ['admin-app']
},
component: BasicLayout,
children: [
{
path: 'index',
name: `${pre}Index`,
meta: {
auth: ['test-view'],
title: '测试页面'
},
component: () => import('@/pages/test/index')
}
]
}
再在router.js中导入test,代码如下:
import index from './modules/index'
import product from './modules/product'
import order from './modules/order'
import user from './modules/user'
// import echarts from './modules/echarts'
import setting from './modules/setting'
import finance from './modules/finance'
import cms from './modules/cms'
import marketing from './modules/marketing'
import app from './modules/app'
import system from './modules/system'
import BasicLayout from '@/components/main'
import frameOut from './modules/frameOut'
import test from './modules/test'
/**
* 在主框架内显示
*/ const frameIn = [
{
path: '/admin/',
meta: {
title: 'CRMEB'
},
redirect: {
name: 'home_index'
},
component: BasicLayout,
children: [
// {
// path: '/admin/system/log',
// name: 'log',
// meta: {
// title: '前端日志',
// auth: true
// },
// component: () => import('@/pages/system/log')
// },
{
path: '/admin/system/user',
name: `systemUser`,
meta: {
auth: true,
title: '个人中心'
},
component: () => import('@/pages/setting/user/index')
},
// 刷新页面 必须保留
{
path: 'refresh',
name: 'refresh',
hidden: true,
component: {
beforeRouteEnter (to, from, next) {
next(instance => instance.$router.replace(from.fullPath))
},
render: h => h()
}
},
// 页面重定向 必须保留
{
path: 'redirect/:route*',
name: 'redirect',
hidden: true,
component: {
beforeRouteEnter (to, from, next) {
// console.log(rom.params.route)
next(instance => instance.$router.replace(JSON.parse(from.params.route)))
},
render: h => h()
}
}
]
},
{
path: '/admin/widget.images/index.html',
name: `images`,
meta: {
auth: ['admin-user-user-index'],
title: '上传图片'
},
component: () => import('@/components/uploadPictures/widgetImg')
},
{
path: '/admin/widget.widgets/icon.html',
name: `imagesIcon`,
meta: {
auth: ['admin-user-user-index'],
title: '上传图标'
},
component: () => import('@/components/iconFrom/index')
},
{
path: '/admin/store.StoreProduct/index.html',
name: `storeProduct`,
meta: {
title: '选择商品'
},
component: () => import('@/components/goodsList/index')
},
{
path: '/admin/system.User/list.html',
name: `changeUser`,
meta: {
title: '选择用户'
},
component: () => import('@/components/customerInfo/index')
},
{
path: '/admin/widget.video/index.html',
name: `video`,
meta: {
title: '上传视频'
},
component: () => import('@/components/uploadVideo/index')
},
index,
cms,
product,
marketing,
order,
user,
finance,
setting,
system,
app,
test
] /**
* 在主框架之外显示
*/ const frameOuts = frameOut /**
* 错误页面
*/ const errorPage = [
{
path: '/admin/403',
name: '403',
meta: {
title: '403'
},
component: () => import('@/pages/system/error/403')
},
{
path: '/admin/500',
name: '500',
meta: {
title: '500'
},
component: () => import('@/pages/system/error/500')
},
{
path: '/admin/*',
name: '404',
meta: {
title: '404'
},
component: () => import('@/pages/system/error/404')
}
] // 导出需要显示菜单的
export const frameInRoutes = frameIn // 重新组织后导出
export default [
...frameIn,
...frameOuts,
...errorPage
]
之后还需要一步,因为路由是缓存下来的,需要清除了环境才能查看
如果对您有所帮助,欢迎您点个关注,我会定时更新技术文档,大家一起讨论学习,一起进路,下一篇写如何解决各个模块文件问题,和大家一起解析下各个模块。

TP6框架--CRMEB学习笔记:布置后台管理框架+配置路由的更多相关文章
- Mina框架的学习笔记——Android客户端的实现
Apache MINA(Multipurpose Infrastructure for Network Applications) 是 Apache 组织一个较新的项目,它为开发高性能和高可用性的网络 ...
- jfinal框架教程-学习笔记
jfinal框架教程-学习笔记 JFinal 是基于 Java 语言的极速 WEB + ORM 开发框架,其核心设计目标是开发迅速.代码量少.学习简单.功能强大.轻量级.易扩展.Restfu ...
- Java框架spring 学习笔记(十八):事务管理(xml配置文件管理)
在Java框架spring 学习笔记(十八):事务操作中,有一个问题: package cn.service; import cn.dao.OrderDao; public class OrderSe ...
- MySQL学习笔记-数据库后台线程
数据库后台线程 默认情况下讲述的InnoDB存储引擎,以后不再重复声明.后台线程有7个--4个IO thread,1个master thread,1个锁监控线程,1个错误监控线程.IO thread的 ...
- golang日志框架--logrus学习笔记
golang日志框架--logrus学习笔记 golang标准库的日志框架非常简单,仅仅提供了print,panic和fatal三个函数,对于更精细的日志级别.日志文件分割以及日志分发等方面并没有提供 ...
- go微服务框架kratos学习笔记五(kratos 配置中心 paladin config sdk [断剑重铸之日,骑士归来之时])
目录 go微服务框架kratos学习笔记五(kratos 配置中心 paladin config sdk [断剑重铸之日,骑士归来之时]) 静态配置 flag注入 在线热加载配置 远程配置中心 go微 ...
- # go微服务框架kratos学习笔记六(kratos 服务发现 discovery)
目录 go微服务框架kratos学习笔记六(kratos 服务发现 discovery) http api register 服务注册 fetch 获取实例 fetchs 批量获取实例 polls 批 ...
- go微服务框架kratos学习笔记七(kratos warden 负载均衡 balancer)
目录 go微服务框架kratos学习笔记七(kratos warden 负载均衡 balancer) demo demo server demo client 池 dao service p2c ro ...
- go微服务框架kratos学习笔记四(kratos warden-quickstart warden-direct方式client调用)
目录 go微服务框架kratos学习笔记四(kratos warden-quickstart warden-direct方式client调用) warden direct demo-server gr ...
- go微服务框架kratos学习笔记八 (kratos的依赖注入)
目录 go微服务框架kratos学习笔记八(kratos的依赖注入) 什么是依赖注入 google wire kratos中的wire Providers injector(注入器) Binding ...
随机推荐
- NVME(学习笔记一)—概述
NVMe概述 NVMe是一个针对基于PCIe的固态硬盘的高性能的.可扩展的主机控制器接口. NVMe的显著特征是提供多个队列来处理I/O命令.单个NVMe设备支持多达64K个I/O 队列,每个I/O队 ...
- gitlab+jenkins+docker持续集成环境搭建实战
介绍 什么是持续集成? 持续集成(CI)是在源代码变更后自动检测.拉取.构建和(在大多数情况下)进行单元测试的过程.持续集成是启动管道的环节(尽管某些预验证 -- 通常称为 上线前检查(pre-fli ...
- 使用yum 报错 :This system is not registered with RHN
解决办法:(假定你已安装yum,且网络畅通)更改yum的源, 即更换/etc/yum.repos.d/rhel-debuginfo.repo 这个文件.首先备份,如下所示: [root@localho ...
- GYM-A. Golden Spirit等
1.题目链接:Problem - A - Codeforces 题意:桥两边有2 * n个不能独立过桥的老人,老人想到对面休息 re 分钟后返回原位置,每次过桥需要花费 cr 分钟,问最少需要多长时间 ...
- Windows11补丁更新后无法使用Wifi和蓝牙
最近在我的ThinkPAD T14上更新了Windows 11补丁,重启后Wifi和蓝牙鼠标都不能使用了,无法连接Wifi网络,也无法添加蓝牙设备. 使用厂家自带的管理工具查看驱动都是最新的,一度不知 ...
- RK3568开发笔记(九):开发板buildroot固件调通RS485口,运行项目中RS485协议调试工具Demo
前言 上一篇已经将Qt移植过去了,此时我们移植整体应用不是什么问题了,那么现在应用对外得接口使用了RS485接口,板载了一个RS485,于是需要调通,兼容这个开发板得RS485. 补充 看 ...
- 第121篇: DOM常用类型(Document、Element)
好家伙,本篇为<JS高级程序设计>第十四章"DOM编程"学习笔记 1.Document类型 Document 类型是 JavaScript 中表示文档节点的类型. ...
- Jenkins+maven+svn+tomcat持续集成环境
前言 团队最近要把项目发布的工作拿过来,所以需要一个持续集成发布系统 直接上步骤. 下载 http://mirrors.jenkins-ci.org/war/latest/ 直接下载war包,我下载的 ...
- 【Azure APIM】APIM self-host 部署在K8S中,如何更换证书呢?
问题描述 APIM self-host(自建网关)部署在K8S中,如何在本地上传及更换证书呢? 问题解答 如果使用Self-host网关,则不支持使用上传到 APIM的 CA 根证书验证服务器和客户端 ...
- 【Azure 应用服务】Azure Function App在部署时候遇见 503 ServiceUnavailable
问题描述 在VS Code中编写好 Azure Function App代码后,通过 func azure functionapp publish 部署失败,抛出 503 Service Unava ...
