赞
踩
首先,去到官网将源码下载下来(官网地址:https://jeecg.com/?ref=nav.poetries.top)
后端需要改的地方:
运行后端:执行jeecg-system-start下的JeecgSystemApplication
前端需要改的地方:
前端运行:
pnpm install
pnpm run dev
<dependencies>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-base-core</artifactId>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-system-biz</artifactId>
</dependency>
</dependencies>
可以引入外部数据表,在navicat中将数据表生成,在online表单开发界面中使用导入数据数据库表
controller、entity、mapper、service为后端代码,vue3Native为前端代码,将前后端代码分别放到对应板块。
接着,操作系统添加路由菜单,把前端组件位置添加至对应的路由,并给角色授权(角色不授权,看不到新建的路由菜单)
重点:增删改查代码引入后端后,jeecg-boot使用的是shiro进行授权和鉴权,需要对角色进行增删改的授权操作。或者删除controller的鉴权注解,如图,将@RequiresPermissions(“department:department:add”)注释掉
下面,介绍如何给角色进行增删改授权:
之后刷新缓存,重新登录即可。
如果业务中有不同的角色可以看到不同的按钮,也可以在前端这样配置
在router=》routers文件下新建一个路由文件,如图mainOut-sl.ts:
/** 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 mainOutSLRoutes: AppRouteModule[] = [ { path: '/duplex', name: 'duplex', component: () => import('/@/views/representative/lpx/main-out/DuplexIndex.vue'), meta: { title: 'duplex', ignoreAuth: true, }, }, { path: '/office', name: 'Office', component: () => import('/@/views/representative/lpx/main-out/OfficeIndex.vue'), meta: { title: 'Office', ignoreAuth: true, }, }, ]; export const mainOutRouteNames = mainOutSLRoutes.map((item) => item.name);
接着在index.ts文件增加你的路由配置,并将路由配置加入basicRoutes中
这样就可以直接免登录访问,例如:localhost:3100/duplex
jeecg提供有用户注册接口,如果只是普通注册,需要将短信验证代码注释。密码是随机生成。
在application-dev.yml配置密钥后可直接使用,使用案例可参考下图。有一个发送短信的工具类:DySmsHelper
效果:表单分类为后端请求返回树形结构
效果:搜索栏自定义搜索条件
子组件在父组件界面声明使用(如图),定义事件:const [registerProcessDesignModal, { openModal: openProcessDesignerModal }] = useModal();
点击事件为preView,传递点击当前列的数据record
子组件取值:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。