Ling5

来自ling
跳转至: 导航搜索

常用链接

amis

目标

  • spring cloud太复杂
  • spring boot作为单体应用,结合nacos eureka 等也能成为微服务,作为核心架构
  • runtime 借鉴 bladex-boot

编码规范

  • 类名不能连续几个大些开头,因为mybatis的mapping查找规则为首字母小写,而spring bean名称会将首大写字母变小写

多租户

创建产品包-->创建多租户(初始化默认数据,用户,角色,菜单,部门,岗位)->创建系统->开发功能->创建菜单->分配角色功能

公共能力

由脚手架提供的基础能力,由产品包的形式分配给其他租户,其他租户只能使用

最高管理角色administrator

租户能力

由租户自己开发的能力,自行挂载菜单

最高管理角色 admin

租户数据删除

select *
from basic_menu
where tenant_id in (select tenant_id from basic_tenant where is_deleted = 1);

delete
from basic_user
where tenant_id in (select tenant_id from basic_tenant where is_deleted = 1);

delete
from basic_role
where tenant_id in (select tenant_id from basic_tenant where is_deleted = 1);

delete
from basic_dept
where tenant_id in (select tenant_id from basic_tenant where is_deleted = 1);

delete
from basic_dict_biz
where tenant_id in (select tenant_id from basic_tenant where is_deleted = 1);

delete
from basic_user_dept
where not exists(select 1 from basic_user where user_id = basic_user.id);

delete
from basic_role_menu
where not exists(select 1 from basic_menu where menu_id = basic_menu.id);

权限

静态权限

示例数据

{ "account": "suadmin", "dept_id": "1123598813738675201", "post_id": "1123598817738675201", "role_id": "1123598816738675201", "role_name": "administrator", "user_id": "1501767120764018689", "user_name": "suadmin" }

判断

"visibleOn": "${CONTAINS(security.role_name,'administrator')}"

配置动态权限

自定义代码中动态权限

多语言

avue

src/store/modules/common.js

language: getStore({ name: 'language' }) || 'zh-cn',

src/page/index/top/top-lang.vue

en/zh-cn

src/main/java/com/ling/cloud/future/amis/controller/AmisI18nController.java

en/zh-cn

common-admin

公共模块

<module>ling-cloud-common-admin-core</module>

spring boot 启动模块

<module>ling-cloud-common-admin-boot</module>

工作流支持模块

<module>ling-cloud-common-admin-flow</module>

magicapi支持模块

<module>ling-cloud-common-admin-magicapi</module>

不添加flow和magicapi启动时间

Started LingApplication in 60.164 seconds (JVM running for 61.683)

添加flow和magicapi启动时间

Started LingApplication in 65.84 seconds (JVM running for 67.747)

常见问题

openjdk 中文乱码

添加 -Dfile.encoding=UTF-8

nohup java -Dfile.encoding=UTF-8 -jar /workspace/admin-boot/ling-boot-biz/target/ling-boot-biz.jar --server.port=5007 \
 -mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.nologging.NoLoggingImpl \
 --sh.path=/workspace/script/admin-boot.sh \
 >>/workspace/logs/5007.log 2>&1 &