Compare commits

...

174 Commits

Author SHA1 Message Date
thinkgem
0e5a9aeeda update README.md 2025-07-10 10:06:38 +08:00
thinkgem
b0e6ab234e 完善xss正则表达式,处理on前面是/的问题;完善beetl的xss格式化,默认使用非html文本处理 2025-07-09 13:37:41 +08:00
thinkgem
0e33e2a6a9 Recover 修改个人信息后跳转目标页面不对问题 2025-07-09 11:03:19 +08:00
thinkgem
d611238583 5.12.1 2025-07-08 00:30:29 +08:00
thinkgem
200c374dee 调整默认的允许重定向地址,只允许项目内部跳转 2025-07-08 00:22:58 +08:00
thinkgem
0408671952 禁用UEditor图片抓取器,对CMS模版查看的地址进行限定 2025-07-08 00:22:57 +08:00
thinkgem
c869dc037c 5.12.1 2025-07-07 18:29:23 +08:00
thinkgem
055d3036fb 新增 SHA-256 工具,使用 ShaUtils 替代 Sha1Utils 2025-07-07 08:56:11 +08:00
thinkgem
94d8dcff3f 代码生成模版,优化 useI18n 参数 2025-07-05 16:31:01 +08:00
thinkgem
3819fb1276 左树右表,切换树节点的时候定向到列表第一页 2025-07-04 15:00:47 +08:00
thinkgem
af42b315b2 代码生成使用简化请求路径时,api文件名中不含模块名。 2025-07-03 16:49:37 +08:00
thinkgem
6bc118efeb update yml 2025-07-03 14:01:02 +08:00
thinkgem
19e395ae1f 默认使用oracle ojdbc8驱动 2025-07-03 13:47:58 +08:00
thinkgem
bdbd616130 代码生成模版支持多级模块设置,如模块管理:ai-core;功能生成模块名:ai.core;新增几个模版参数:moduleMinus、modulePath、subModuleNameDot、subModulePath 2025-06-30 11:19:56 +08:00
thinkgem
b12a225768 修正beetl修改密码后再登录系统,没有跳转到首页问题 2025-06-30 11:18:50 +08:00
thinkgem
1ca6bfa942 生成模版优化 2025-06-27 17:18:19 +08:00
thinkgem
bf8b05a49e vue主键为输入框的时候,不验证主键重复问题 2025-06-27 17:13:31 +08:00
thinkgem
26587e106f ztree 当没有title数据的时候,使用name作为title显示 2025-06-27 09:22:12 +08:00
thinkgem
7317bc227e 增加 spring.cache.globalKeyNames 参数,指定哪些为全局缓存,节省资源 2025-06-23 09:37:40 +08:00
thinkgem
3392c66fd5 修正请求对象被回收提示 2025-06-21 19:30:34 +08:00
thinkgem
6c8e8b930b 新增vue前端模块代码生成模板 2025-06-18 11:03:33 +08:00
thinkgem
2e832ef693 代码优化 2025-06-10 11:46:47 +08:00
thinkgem
b10f9d36fb lint type 2025-06-08 10:42:32 +08:00
thinkgem
ae2d2ae76f 代码生成模板默认替换为 Monorepo 2025-06-08 10:38:34 +08:00
thinkgem
6d5cd49c19 增加ureport接口权限配置 2025-06-06 15:03:15 +08:00
thinkgem
6b7813beaf 增加JsonFormat条件防止出现类型转换问题 2025-06-05 13:04:34 +08:00
thinkgem
119ceae9fe update jdbc driver 2025-05-27 23:36:36 +08:00
thinkgem
f7381ab736 5.12.0 2025-05-26 10:19:07 +08:00
thinkgem
5a830b7307 新增用户界面的时区切换 2025-05-26 09:42:50 +08:00
thinkgem
b5bde1e58c JsonMapper日期类型转换代码优化 2025-05-24 18:42:19 +08:00
thinkgem
a35d4654f5 新增 LocaleUtils 本地化语言和时区对象管理工具类 2025-05-24 18:41:41 +08:00
thinkgem
4634055b43 DateUtils.parseDate 多格式字符串解析性能优化,并支持时区 2025-05-24 18:41:02 +08:00
thinkgem
b4629aa465 更新语言包 2025-05-24 18:36:24 +08:00
thinkgem
4b6cdce814 beetl 日期格式化,使用性能更好的 DataUtils 管理 2025-05-24 18:35:24 +08:00
thinkgem
c478f2a969 代码优化 2025-05-24 16:59:16 +08:00
thinkgem
c7d317c1da JsonMapper 使用 DateUtils 解析日期,以支持更多的格式;优化 JsonFormat 注解非日期类型的自定义 2025-05-19 10:44:20 +08:00
thinkgem
8f6fd6000f 移除 web.json.defaultDateFormat 参数,使用 DateUtils 解析,以支持更多的格式 2025-05-19 10:41:10 +08:00
thinkgem
8f1dbaf3bd DateUtils 增加 yyyy-MM-dd'T'HH:mm:ss'Z' 格式解析 2025-05-19 10:38:43 +08:00
thinkgem
a414489ea9 默认包含达梦和人大金仓驱动,减少咨询,由于个别jdbc驱动体积比较大,可按需移除依赖 2025-05-12 11:09:40 +08:00
thinkgem
dc23dbcd6d 当已知异常信息包含更多异常的时候,将异常信息打印到日志中 2025-05-09 17:49:23 +08:00
thinkgem
62294446bd fileAllowSuffixes add .ofd 2025-05-09 14:29:14 +08:00
thinkgem
d7433b3c45 顶部消息框优化 2025-05-08 09:51:58 +08:00
thinkgem
f88e432403 next 2025-05-08 09:50:49 +08:00
thinkgem
3d99759a06 表单界面优化 2025-05-07 14:55:06 +08:00
thinkgem
7601d4d530 增加参数 mybatis.orderBySqlFilter 仅对内部参数设置生效,UI传输的数据仍然必须经过过滤。 2025-05-07 12:19:23 +08:00
thinkgem
59996a2a5b 一级菜单美化,圆角展示选中背景色 2025-05-06 15:08:32 +08:00
thinkgem
a35b7fd143 切换主题时,刷新当前页,不跳转到首页 2025-05-06 15:06:05 +08:00
thinkgem
ad28115fb3 update DaoMapperTest.java 2025-04-29 15:43:04 +08:00
thinkgem
9a816b18c2 移动端代码生成模板增强 2025-04-27 22:16:12 +08:00
thinkgem
f3d283ae4e 移动端模板补充日期时间组件生成 2025-04-27 15:39:11 +08:00
thinkgem
3abf83ff63 修正移动端模板的一些问题,textarea v-model 重复问题;maxlength 为 0 问题;列表 query 参数不对问题 2025-04-27 14:23:47 +08:00
thinkgem
9fedbcaa64 增加 按多个角色查询用户接口 user.roleCodes 2025-04-25 18:47:42 +08:00
thinkgem
bd059ab63e 当选择控件未设置查询列的时候没有生成office接口问题 2025-04-25 18:46:39 +08:00
thinkgem
053f1ee499 5.11.1 2025-04-23 09:41:48 +08:00
thinkgem
4fa4ade638 健壮性增强 2025-04-21 13:40:08 +08:00
thinkgem
1ae24c82c0 删除用不到的文件 2025-04-21 13:38:33 +08:00
thinkgem
4b16fcf58a 界面优化 2025-04-19 09:58:30 +08:00
thinkgem
5f18c9635d 整理初始化数据库脚本菜单,扩展模块移到扩展菜单里。 2025-04-18 15:38:55 +08:00
thinkgem
8b58259c97 update Dockerfile 2025-04-17 16:15:44 +08:00
thinkgem
ce47d7f341 update docker-build.sh 2025-04-17 14:00:41 +08:00
thinkgem
6ad05b6037 调整属性文件加载顺序,classpath:application.yml 优先于 classpath:config/application.yml(升级注意) 2025-04-17 09:07:44 +08:00
thinkgem
645f6f68fc update h2 2025-04-17 09:06:37 +08:00
thinkgem
1a92a275cd 代码优化 2025-04-17 09:05:49 +08:00
thinkgem
33c1865bf1 优化界面 2025-04-15 12:42:09 +08:00
thinkgem
5e67bd380b 表格操作列图标更新、默认按钮美化、表格设置按钮更新 2025-04-14 12:59:22 +08:00
thinkgem
77f245cbd7 弹窗消息透明度修改为0.9 2025-04-14 12:55:23 +08:00
thinkgem
95f68ac197 新增 Markdown 编辑器,文件上传接口 2025-04-09 15:07:40 +08:00
thinkgem
dc348365ce update PropertiesUtils 2025-04-07 18:39:28 +08:00
thinkgem
8c7a50f679 remove SchemeHttpsConfig 2025-04-07 18:38:36 +08:00
thinkgem
a8fb860bc1 支持 dataSourceNames 免配置,自动读取 jdbc 的属性来加载多数据源 2025-04-07 18:37:15 +08:00
thinkgem
737219388c 代码生成模板中增加重启流程操作 2025-04-07 12:04:57 +08:00
thinkgem
f01b6e7818 webp格式上传,默认参数少个点 2025-04-07 11:53:51 +08:00
thinkgem
ec95efccbc 启用岗位角色权限权限后,给予操作提示 2025-04-04 17:18:50 +08:00
thinkgem
5ffcba1c4e 增加参数:登录后激活当前用户所在的主部门,默认为不激活即混合权限 2025-04-04 10:49:04 +08:00
thinkgem
78c10ba2be 优化 DataScope 数据权限,移除 apiMode 参数,增加 apiMode 方法;
优化 DataScope 数据权限,增加 debug、joinMode、ruleSql 方法,方便动态调用
优化 扩展查询 SQL 实现,使用 sqlMap().getColumn().addExtSql 替代 extColumnKeys;
优化 扩展查询 SQL 实现,使用 sqlMap().getTable().addExtSql 替代 extFormKeys;
优化 扩展查询 SQL 实现,使用 sqlMap().getWhere().addExtSql 替代 extWhereKeys;
新增 扩展更新 SQL 语句,sqlMap().getUpdate().addExtColumnSql 和 addExtWhereSql
2025-04-02 16:38:23 +08:00
thinkgem
e28f4c9d12 优化 SqlMap 性能,增加 update 和 insert 生成参数接口,方便在 Mapper 中直接引用。 2025-04-01 11:57:26 +08:00
thinkgem
f4adf804a3 update title 2025-03-31 11:27:49 +08:00
thinkgem
95b08d24cf 优化树表性能,左树右表联动时,减少一次查询 2025-03-31 09:42:17 +08:00
thinkgem
198e76110b 查询条件如区域、公司、配置、机构、岗位、栏目、站点、分类等显示编码使用 like 查询,等其它功能查询细节优化 2025-03-30 15:04:53 +08:00
thinkgem
c5cbb22621 优化树表管理代码生成模板,左树右表代码生成模板 2025-03-29 22:22:30 +08:00
thinkgem
c2fc3e5c96 /test/testTree/list to /test/testTree/index 2025-03-29 22:08:09 +08:00
thinkgem
00b53ba722 EncodeUtils增加手机号和邮箱的掩码处理方法 2025-03-29 22:07:18 +08:00
thinkgem
17d6d9a822 testTree增加index,左树快捷选择 2025-03-29 22:04:29 +08:00
thinkgem
0465f35d4c 支持机构子节点数据的机构负责人和电话的模糊查询 2025-03-29 11:15:58 +08:00
thinkgem
a2b19c4b17 更正机构导出模板的显示标题 2025-03-29 11:14:24 +08:00
thinkgem
99321f4943 公司和部门管理列表,根据代码模糊查询时,可以查出子节点 2025-03-28 10:20:19 +08:00
thinkgem
a4c3476693 优化外部调用接口调用测试类 2025-03-27 14:15:36 +08:00
thinkgem
415dc88a79 EncodeUtils.encodeUrl 忽略字符编码传递空值,默认 UTF-8 2025-03-27 14:14:24 +08:00
thinkgem
eaad1b6e51 next version 2025-03-27 09:00:06 +08:00
thinkgem
97e318725a 5.11.0 2025-03-24 14:42:12 +08:00
thinkgem
48801a5596 新增 sys.office.notAllowDeleteIfUserExists 和 sys.company.notAllowDeleteIfUserExists 参数,增加删除机构和公司数据的时候校验是否有用户 2025-03-24 14:03:51 +08:00
thinkgem
d127c2dc32 清理组织和公司下的用户缓存,包含子机构 2025-03-24 14:02:54 +08:00
thinkgem
4befea3e6f update productVersion 2025-03-24 13:59:26 +08:00
thinkgem
96a07e886d update 2025-03-22 18:52:01 +08:00
thinkgem
2f2b508225 网站优化一些基础样式 2025-03-22 18:48:57 +08:00
thinkgem
fbac25ef38 文章按权重排序修复 2025-03-22 18:48:12 +08:00
thinkgem
3aff37f35a add job init remarks 2025-03-17 15:41:47 +08:00
thinkgem
a1beed5b5e 属性获取工具,支持从系统环境变量中获取参数 2025-03-11 15:23:02 +08:00
thinkgem
fee4848ae2 update README.md 2025-03-11 15:22:26 +08:00
thinkgem
84d59dea96 jeesite-*.yml模块配置文件,增加IDEA提示助手 2025-03-08 10:11:37 +08:00
thinkgem
688797ae40 update 2025-03-04 13:03:34 +08:00
thinkgem
0132eb2a9e 修正安全管理器限制的本地调用 2025-03-04 09:51:14 +08:00
thinkgem
7eeae69a63 账号找回密码增加租户参数 2025-03-02 21:03:15 +08:00
thinkgem
6a83a0f8f2 登录界面租户框调整到上面 2025-02-28 16:55:15 +08:00
thinkgem
9c5dd7d7bb update config 2025-02-28 13:35:11 +08:00
thinkgem
14d772cf6d 个人中心代码优化 2025-02-26 14:21:31 +08:00
thinkgem
ee6715de0a next 2025-02-24 09:24:54 +08:00
thinkgem
52f3b0d2bf 新增字段权限接口,过滤 select 返回值,update 和 insert 字段值 2025-02-21 15:52:13 +08:00
thinkgem
f27dc31fb8 增加更严格的权限控制,对单条数据进行数据权限过滤 2025-02-21 15:47:17 +08:00
thinkgem
74b806ca1b AppComment合并更新状态方法 2025-02-21 15:45:05 +08:00
thinkgem
29f3c6894c 优化 编辑公司时,清理公司下的用户缓存 2025-02-20 17:50:06 +08:00
thinkgem
f9bcba6994 优化 编辑机构时,清理机构下的用户缓存 2025-02-20 17:49:44 +08:00
thinkgem
ed40654d6a 新增 findUserListByCompanyCodes 方法,根据公司编码获取用户编码和名称 2025-02-20 17:49:06 +08:00
thinkgem
208ba4a86e fileupload bizType参数为空时,readonly不生效问题 2025-02-20 17:47:42 +08:00
thinkgem
a88eca25ac update README.md 2025-02-17 10:49:20 +08:00
thinkgem
5191b82b0c 点击右上角【Star】收藏本软件 ^_^ 2025-02-17 10:49:08 +08:00
thinkgem
63e654977e 5.10.1 2025-02-15 21:16:53 +08:00
thinkgem
fed9b0b96c 自定义数据权限分配树,默认展开等级设为1 2025-02-15 16:41:18 +08:00
thinkgem
f049d83c5a 登录后不指定默认当前部门编号 2025-02-15 16:40:34 +08:00
thinkgem
8eab281a67 更新 visual 类名 2025-02-14 22:04:04 +08:00
thinkgem
6a985081b6 新增 条件规则数据权限、自定义SQL数据权限,暂存 2025-02-12 18:39:55 +08:00
thinkgem
af83d8fb2d 优化 二级管理员参数提示信息 2025-02-12 18:17:35 +08:00
thinkgem
46a1b57f63 remove aria-hidden="true" 2025-02-12 18:15:50 +08:00
thinkgem
5a3a04c987 新增 按菜单进行数据权限授权,后端通过addFilterByPermission方法调用权限。 2025-02-11 14:28:47 +08:00
thinkgem
728de01676 新增 user.dataScopeJoinMode 参数,默认关闭 JOIN 模式的数据权限,如有需要可打开此参数 2025-02-11 12:52:06 +08:00
thinkgem
ac699f9057 新增 列名 columnName 正则表达式的安全过滤 2025-02-11 12:46:41 +08:00
thinkgem
97b299a113 update 2025-02-11 12:43:57 +08:00
thinkgem
1b32b7700a 增加默认值 2025-02-07 20:44:16 +08:00
thinkgem
8b54a7c0e8 更新配置文件 2025-02-07 17:22:39 +08:00
thinkgem
b1b29715b8 代码优化 EmpUtils 增加 getCompanyCodes、getCompanyParentCodess 方法 2025-02-07 17:11:33 +08:00
thinkgem
477c5dcfbf 将 router.push 替换为 useGo 增加代码健壮性 2025-02-07 16:03:27 +08:00
thinkgem
761901e61d add ObjectUtilsTest.java 2025-02-05 21:10:28 +08:00
thinkgem
6de3df8c76 修正String转Long丢失精度问题 2025-02-05 21:09:53 +08:00
thinkgem
a790e357c7 新增 切换部门功能、多部门岗位权限 2025-02-01 16:22:34 +08:00
thinkgem
fa8d88285f 优化 查询当前员工关联的岗位信息和附属机构信息接口 2025-01-28 11:46:57 +08:00
thinkgem
2aa8472072 新增 获取当前用户岗位列表 EmpUtils.getEmployeePostList 缓存接口 2025-01-28 11:45:31 +08:00
thinkgem
83a8ed16d2 新增 岗位查询角色接口新增 postCode_in 查询条件 2025-01-28 11:44:10 +08:00
thinkgem
a7b458af90 丰富 EmployeeOffice 返回结果 2025-01-28 11:43:21 +08:00
thinkgem
4e6f27a2ab 新增 form:treeselect 组件 fieldNames 属性,自定义数据源的字段名 2025-01-28 11:41:17 +08:00
thinkgem
4287437d2e 从LoginController分离出SwitchController类 2025-01-27 23:43:11 +08:00
thinkgem
c86d16320f 修正 sqlserver 分页时,缺少 order by 的问题 2025-01-21 15:37:38 +08:00
thinkgem
30e725d256 优化 切换当前身份时,自动对应身份的桌面地址 2025-01-20 17:31:25 +08:00
thinkgem
dea24e73ec 新增 RSA 非对称加密工具 2025-01-16 17:36:02 +08:00
thinkgem
a5ae486f52 update README.md 2025-01-16 17:27:08 +08:00
thinkgem
34d55bfc4e format code 2025-01-14 10:37:46 +08:00
thinkgem
f591f4c07a update MsgPushTest 2025-01-13 15:09:47 +08:00
thinkgem
620b871368 update README.md 2025-01-10 14:00:31 +08:00
thinkgem
3d68d9f660 upgrade h2 to 2.2.224 2025-01-08 17:04:04 +08:00
thinkgem
696e6a97b1 update useless code 2025-01-08 17:02:48 +08:00
thinkgem
587ad5caef update README.md 2025-01-06 11:22:20 +08:00
thinkgem
d7d6bea8fe mybatis 3.5.16 2025-01-06 10:26:00 +08:00
thinkgem
2509d3cf2f next version 2025-01-06 09:58:43 +08:00
thinkgem
bb8a9e1054 update area data 2025-01-01 19:44:25 +08:00
thinkgem
55ad21e228 5.10.0 2025-01-01 11:05:38 +08:00
thinkgem
6b29c8c937 5.10.0 2024-12-31 21:04:15 +08:00
thinkgem
cf32922387 update import icon 2024-12-31 21:04:15 +08:00
thinkgem
5e87d44a3c 2025 2024-12-30 14:56:56 +08:00
thinkgem
0ef1eca662 update 2024-12-29 16:43:20 +08:00
thinkgem
203e21beed update bin 2024-12-26 11:42:58 +08:00
thinkgem
34b1ba00fd 上传文件必填时,防止表单验证提示输入历史 2024-12-25 16:20:46 +08:00
thinkgem
8e64c2c51b update README.md 2024-12-25 15:50:06 +08:00
thinkgem
62392702a6 update jdbc url 2024-12-25 10:30:26 +08:00
thinkgem
580f5eea55 remove beetl includeJSP 2024-12-23 17:15:54 +08:00
thinkgem
3623824a01 update README.md 2024-12-13 12:59:21 +08:00
thinkgem
b1409e88a1 update README.md 2024-12-12 18:16:41 +08:00
thinkgem
2b25eaa591 增加参考配置,可查看哪些用户的数据,ctrlPermi 更改为 0 后显示 2024-12-11 10:32:19 +08:00
thinkgem
38c8ea825a 细节优化,控制业务范围重命名为业务范围 2024-12-11 10:27:48 +08:00
thinkgem
56be7dd689 移除重复参数 2024-12-11 10:23:03 +08:00
thinkgem
8623b1a497 新增BigDecimalType 2024-12-05 11:12:14 +08:00
thinkgem
1c8a5adcd3 update 2024-12-05 11:12:07 +08:00
thinkgem
8d1bbde93b update version 2024-12-04 14:30:02 +08:00
thinkgem
a9054c7567 使用对象存储时,文件管理的在线预览文件中的下载地址修正 2024-12-04 14:17:22 +08:00
thinkgem
bca5facc4e update 2024-11-26 20:10:15 +08:00
thinkgem
a8d1080cfd update README.md 2024-11-24 20:36:53 +08:00
328 changed files with 9795 additions and 7335 deletions

13
LICENSE
View File

@@ -206,15 +206,16 @@
1. 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款。
2. 不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
3. 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议、版权声明和其他原作者
3. 在使用本软件时,由于它集成了众多第三方开源软件,请共同遵守这些开源软件的使用许可条款规定。
4. 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议、版权声明和其他原作者
规定需要包含的说明(请尊重原作者的著作权,不要删除或修改文件中的`Copyright`和`@author`信息)
更不要,全局替换源代码中的 jeesite 或 ThinkGem 等字样,否则你将违反本协议条款承担责任。
4. 您若套用本软件的一些代码或功能参考,请保留源文件中的版权和作者,需要在您的软件介绍明显位置
5. 您若套用本软件的一些代码或功能参考,请保留源文件中的版权和作者,需要在您的软件介绍明显位置
说明出处,举例:本软件基于 JeeSite 快速开发平台并附带链接http://jeesite.com
5. 任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
6. 如果你对本软件有改进,希望可以贡献给我们,共同进步。
7. 本项目已申请软件著作权,请尊重开源,感谢阅读。
8. 无用户数限制,无在线人数限制,放心使用。
6. 任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
7. 如果你对本软件有改进,希望可以贡献给我们,共同进步。
8. 本项目已申请软件著作权,请尊重开源,感谢阅读。
9. 无用户数限制,无在线人数限制,放心使用。
版权所有:济南卓源软件有限公司

133
README.md
View File

@@ -4,10 +4,13 @@
</p>
<h3 align="center" style="margin:30px 0 30px;font-weight:bold;font-size:30px;">快速开发平台 - Spring Boot</h3>
<p align="center">
<a href="https://jeesite.com/docs/upgrade/" target="__blank"><img alt="JeeSite-5.9" src="https://img.shields.io/badge/JeeSite-V5.9-success.svg"></a>
<a href="https://spring.io/projects/spring-boot#learn" target="__blank"><img alt="SpringBoot-2.7/3.2" src="https://img.shields.io/badge/SpringBoot-2.7/3.2-blue.svg"></a>
<a href="https://gitee.com/thinkgem/jeesite5/stargazers" target="__blank"><img alt="star" src="https://gitee.com/thinkgem/jeesite5/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/thinkgem/jeesite-vue/stargazers" target="__blank"><img alt="star" src="https://gitee.com/thinkgem/jeesite-vue/badge/star.svg?theme=dark"></a>
<a href="https://spring.io/projects/spring-boot" target="__blank"><img alt="SpringBoot-V2.7/3.4" src="https://img.shields.io/badge/SpringBoot-V2.7/3.4-blue.svg"></a>
<a href="https://v3.cn.vuejs.org/" target="__blank"><img alt="TypeScript-Vue3" src="https://img.shields.io/badge/TypeScript-Vue3-green.svg"></a>
<a href="https://jeesite.com/docs/upgrade/" target="__blank"><img alt="JeeSite-V5.x" src="https://img.shields.io/badge/JeeSite-V5.x-success.svg"></a>
<a href="https://gitee.com/thinkgem/jeesite5" target="__blank"><img alt="star" src="https://gitee.com/thinkgem/jeesite5/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/thinkgem/jeesite-vue" target="__blank"><img alt="star" src="https://gitee.com/thinkgem/jeesite-vue/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/thinkgem/jeesite" target="__blank"><img alt="star" src="https://gitee.com/thinkgem/jeesite/badge/star.svg?theme=gvp"></a>
<a href="https://gitcode.com/thinkgem/jeesite" target="__blank"><img alt="star" src="https://gitcode.com/thinkgem/jeesite/star/badge.svg"></a>
</p>
------
@@ -24,28 +27,40 @@
* 使用文档:<https://jeesite.com/docs>
* 问题反馈:<http://jeesite.net> [【新手必读】](https://gitee.com/thinkgem/jeesite5/issues/I18ARR)
* 需求收集:<https://gitee.com/thinkgem/jeesite5/issues/new>
* QQ 群:`127515876``209330483``223507718``709534275``730390092``1373527``183903863(外包)`
* 微信群:添加客服微信 <http://s.jeesite.com> 邀请您进群
* 联系我们:<http://s.jeesite.com>
* 关注微信公众号,了解最新动态:
<p style="padding-left:40px">  
<img alt="JeeSite微信公众号" src="https://jeesite.com/assets/images/mp.png" width="200">
</p>
* 源码仓库地址1<https://gitee.com/thinkgem/jeesite5>
* 源码仓库地址2<https://github.com/thinkgem/jeesite5>
* 源码仓库地址3<https://gitcode.com/thinkgem/jeesite5>
* 分离版前端源码仓库地址1<https://gitee.com/thinkgem/jeesite-vue>
* 分离版前端源码仓库地址2<https://github.com/thinkgem/jeesite-vue>
* 分离版前端源码仓库地址3<https://gitcode.com/thinkgem/jeesite-vue>
* QQ 群:`127515876``209330483``223507718``709534275``730390092``1373527``183903863(外包)`
* 微信群:如果二维码过期,请尝试刷新图片,或者添加客服微信 jeesitex 邀请您进群
<p style="padding-left:40px"><a href="https://jeesite.com/assets/images/wxg_cur.png" target="_blank">  
<img alt="JeeSite微信群" src="https://jeesite.com/assets/images/wxg_cur.png" width="200"/></a>
</p>
* 源码仓库地址:
[Gitee](https://gitee.com/thinkgem/jeesite5)、
[GitCode](https://gitcode.com/thinkgem/jeesite5)、
[GitHub](https://github.com/thinkgem/jeesite5)
* 分离版源码仓库地址:
[Gitee](https://gitee.com/thinkgem/jeesite-vue)、
[GitCode](https://gitcode.com/thinkgem/jeesite-vue)、
[GitHub](https://github.com/thinkgem/jeesite-vue)
* 源码合集仓库地址:
[GVP](https://gitee.com/thinkgem/jeesite/tree/v5.springboot3)、
[G-Star](https://gitcode.com/thinkgem/jeesite/overview?ref=v5.springboot3)、
[GitHub](https://github.com/thinkgem/jeesite/tree/v5.springboot3)
## 平台介绍
* JeeSite 快速开发平台,不仅仅是一个后台开发框架,它是一个企业级快速开发解决方案,后端基于经典组合 Spring Boot、Shiro、MyBatis前端采用 Beetl、Bootstrap、AdminLTE 经典开发模式,或者分离版 Vue3、Vite、Ant Design Vue、TypeScript、Vben Admin 最先进技术栈。
* JeeSite 快速开发平台,低代码,轻量级,不仅仅是一个后台开发框架,它是一个企业级快速开发解决方案,后端基于经典组合 Spring Boot、Shiro、MyBatis前端采用分离版 Vue3、Vite、Ant Design Vue、TypeScript、Vben Admin 最先进技术栈,或者 Beetl、Bootstrap、AdminLTE 经典开发模式
* 提供在线数据源管理、数据表建模、代码生成等功能,可自动创建业务模块代码工程和微服务模块代码工程,自动生成前端代码和后端代码;包括核心功能模块如:组织机构、用户、角色、岗位、管理员、权限审计、菜单及按钮权限、数据权限、模块管理、系统参数、字典管理、系统监控、数据监控等;扩展功能如:工作流引擎、内容管理、消息推送、单点登录、第三方登录、在线作业调度、对象存储、可视化数据大屏、报表设计器、在线文件预览、国际化、全文检索、统一认证服务等。
* 本平台采用松耦合设计,微内核和插件架构,模块增减便捷,支持集群,支持 SaaS 架构,支持读写分离、分库分表、Spring Cloud 微服务架构;并内置了众多账号安全设置、密码策略、系统访问限制等安全解决方案,支持等保评测。
* 本平台采用松耦合设计,真正的轻量级,微内核,快速部署,插件架构,模块增减便捷,支持扩展 SaaS 架构、集群部署、读写分离、分库分表、Spring Cloud 微服务架构;并内置了众多账号安全设置、密码策略、系统访问限制等安全解决方案,支持等保评测。
* 本平台专注于为初级研发人员提供强大的支持,使他们能够高效、快速地开发出复杂的业务功能,同时为中高级人员腾出宝贵的时间,专注于更具战略性和创新性的任务。我们致力于让开发者能够全心投入业务逻辑中,而将繁琐的技术细节交由平台来封装处理。这不仅降低了技术实现的难度,还确保了系统架构的稳定性和安全性,进而帮助企业节省人力成本、缩短项目周期,并提高整体软件的安全性和质量。
@@ -61,7 +76,7 @@
* JeeSite 非常易于二次开发,可控性高,整体架构清晰、技术稳定而先进、源代码书写规范、经典技术会的人多、易于维护、易于扩展、安全稳定。
* JeeSite 功能全,知识点非常多,也非常少。因为她使用的都是一些通用的技术,通俗的设计风格,大多数基础知识点,多数人都能掌握,所以每一个 JeeSite 的功能点都非常容易掌握。只要您学会使用这些功能和组件的应用,就可以顺利完成系统开发了。
* JeeSite 功能全,知识点非常多,也非常少。因为她使用的都是一些通用的技术,通俗的设计风格,大多数基础知识点,多数人都能掌握,所以每一个 JeeSite 的功能点都非常容易掌握。只要您学会使用这些功能和组件的应用,就可以顺利完成系统开发了。
* JeeSite 是一个低代码开发平台具有较高的封装度、扩展性封装不是限制您去做一些事情而是在便捷的同时也具有较好的扩展性在不具备一些功能的情况下JeeSite 提供了扩展接口,提供了原生调用方法。
@@ -86,7 +101,7 @@
* 前端组件jQuery 3.7、jqGrid 4.7、layer 3.5、zTree 3.5、jQuery Validation
* 分离前端版Node.js、TypeScript、Vue3、Vite、Ant Design Vue、Vue Vben Admin
* 工作流引擎Flowable 6.6、符合 BPMN 规范、在线流程设计器、中国式流程、退回、撤回、自由流
* Bootstrap 版 支持 IE9 及以上版本及其他所有现代浏览器,如:谷歌、火狐、国产浏览器 等
* Bootstrap 版 支持 IE10 及以上版本及其他所有现代浏览器,如:谷歌、火狐、国产浏览器 等
* Vue3 版 支持现代浏览器,如:谷歌 Chrome 86+、火狐、国产浏览器 等
* 技术选型(详细):<http://jeesite.com/docs/technology/>
* JeeSite Vue 版本:<https://gitee.com/thinkgem/jeesite-vue>
@@ -97,6 +112,7 @@
* 内置功能:<https://jeesite.com/docs/function/>
* 目录结构:<https://jeesite.com/docs/catalog/>
* 架构特点:<https://jeesite.com/docs/feature/>
* 参数配置:<https://jeesite.com/docs/config/>
* 开发规范:<https://jeesite.com/docs/standard/>
* 代码生成:<https://jeesite.com/docs/code-gen/>
@@ -118,8 +134,8 @@
### 在线演示
1. 全栈版地址:<http://demo.jeesite.com>
2. Vue3分离版地址:<http://vue.jeesite.com>
1. 分离版地址:<https://vue.jeesite.com>
2. 经典版地址:<https://demo.jeesite.com>
### 本地运行
@@ -131,10 +147,11 @@
6. 浏览器访问:<http://127.0.0.1:8980/js> 账号 system 密码 admin
7. 部署常见问题:<https://jeesite.com/docs/faq/>
8. 分离端安装:<https://jeesite.com/docs/vue-install-deploy/>
9. 分离端常见问题:<https://jeesite.com/docs/vue-faq/>
### 快速运行
1. 环境准备:`JDK 1.8 or 11、17``Maven 3.6+`、无需准备数据库(使用内嵌 H2 DB、Vue资源包)
1. 环境准备:`JDK 1.8 or 11、17``Maven 3.6+`、无需准备数据库(使用内嵌 H2 DB、包含 Vue 和 全栈双版本
2. 下载源码:<https://gitee.com/thinkgem/jeesite5/repository/archive/v5.9.zip> 并解压
3. 执行脚本:`/web-fast/bin/run-tomcat.bat` 启动服务即可(自动初始化库)
4. Vue分离版本地址<http://127.0.0.1:8980/vue/login>
@@ -144,7 +161,7 @@
### 容器运行
- 拉取 Docker 镜像(演示使用,JeeSite版本较久
- 拉取 Docker 镜像JeeSite版本不是最新
```sh
docker pull thinkgem/jeesite-web
```
@@ -154,31 +171,50 @@ docker run --name jeesite-web -p 8980:8980 -d --restart unless-stopped \
-v ~/:/data thinkgem/jeesite-web && docker logs -f jeesite-web
```
- 浏览器访问:<http://127.0.0.1:8980/js/> 账号 system 密码 admin
- 分离端安装:<https://jeesite.com/docs/vue-install-deploy/>
### 开发环境
1. 部署运行文档:<https://jeesite.com/docs/install-deploy/>
2. 部署常见问题:<https://jeesite.com/docs/faq/>
3. 分离端安装<https://jeesite.com/docs/vue-install-deploy/>
3. 分离端运行文档<https://jeesite.com/docs/vue-install-deploy/>
4. 分离端常见问题:<https://jeesite.com/docs/vue-faq/>
## 技术文章
* 菜单和按钮权限:<https://jeesite.com/docs/permi-shiro/>
* 强大的数据权限:<https://jeesite.com/docs/service-datascope/#数据权限>
* 表结构数据字典<https://jeesite.com/docs/code-gen/#表结构数据字典>
* 持久层设计<https://jeesite.com/docs/dao-mybatis/>
* 后端工具<https://jeesite.com/docs/sys-utils/>
* 库表生成、代码生成https://jeesite.com/docs/code-gen/>
* 菜单权限、按钮权限:<https://jeesite.com/docs/permi-shiro/>
* 数据权限、库事务<https://jeesite.com/docs/service-datascope/#数据权限>
* 表结构、数据字典<https://jeesite.com/docs/code-gen/#表结构数据字典>
* 持久层框架、SQL<https://jeesite.com/docs/dao-mybatis/>
* 后端常用工具:<https://jeesite.com/docs/sys-utils/>
**分离版**
* 版本介绍:<https://jeesite.com/docs/jeesite-vue/>
* 源码解析:<https://jeesite.com/docs/vue-crud-view/>
* 表单组件:<https://jeesite.com/docs/vue-basic-form/>
* 表格组件:<https://jeesite.com/docs/vue-basic-table/>
* 参数配置:<https://jeesite.com/docs/vue-settings/>
* 常用组件:<https://jeesite.com/docs/vue-comp/>
* 前端权限:<https://jeesite.com/docs/vue-auth/>
* 图标组件:<https://jeesite.com/docs/vue-icon/>
* 前端样式库:<https://jeesite.com/docs/vue-style/>
* 多语言国际化:<https://jeesite.com/docs/vue-i18n/>
**经典版**
* 表单组件:<https://jeesite.com/docs/views-beetl/>
* 表格组件:<https://jeesite.com/docs/datagrid/>
* js工具:<https://jeesite.com/docs/jeesite-js/>
* 常用工具:<https://jeesite.com/docs/jeesite-js/>
* 自定义主题:<https://jeesite.com/docs/custom-views/>
## 专题文章
* 自定义主题<https://jeesite.com/docs/custom-views/>
* 国际化多语言:<https://jeesite.com/docs/i18n-locale/>
* 接口文档:<https://jeesite.com/docs/mobile-rest-api/>
* 系统接口文档<https://jeesite.com/docs/mobile-rest-api/>
* 多语言国际化<https://jeesite.com/docs/i18n-locale/>
* BPM工作流引擎<https://jeesite.com/docs/bpm/>
* CMS内容管理<https://jeesite.com/docs/cms/>
* AI知识库助手<https://jeesite.com/docs/cms-ai/>
* 用户类型:<https://jeesite.com/docs/user-type/>
* 消息推送:<https://jeesite.com/docs/msg-push-use/>
* 单点登录:<https://jeesite.com/docs/sso-cas/>
@@ -199,39 +235,30 @@ docker run --name jeesite-web -p 8980:8980 -d --restart unless-stopped \
* Spring Cloud 微服务:<https://jeesite.com/docs/springcloud/>
* 分布式事务 Seata<https://jeesite.com/docs/springcloud-seata/>
* 读写分离、分库分表:<https://jeesite.com/docs/sharding/>
## 前后分离版
* Vue 版介绍:<https://jeesite.com/docs/jeesite-vue/>
* Vue 安装部署:<https://jeesite.com/docs/vue-install-deploy/>
* Vue 参数配置:<https://jeesite.com/docs/vue-settings/>
* Vue 前端权限:<https://jeesite.com/docs/vue-auth/>
* Vue 源码解析:<https://jeesite.com/docs/vue-crud-view/>
* Vue 表单组件:<https://jeesite.com/docs/vue-basic-form/>
* Vue 表格组件:<https://jeesite.com/docs/vue-basic-table/>
* Vue 常用组件:<https://jeesite.com/docs/vue-comp/>
* Vue 图标组件:<https://jeesite.com/docs/vue-icon/>
* Vue 国际化多语言:<https://jeesite.com/docs/vue-i18n/>
* Vue 样式库:<https://jeesite.com/docs/vue-style/>
* 监控系统集成:<https://jeesite.com/docs/webadmin/>
* 追踪系统集成:<https://jeesite.com/docs/skywalking/>
* ELK日志收集<https://jeesite.com/docs/elk-log/>
## 授权协议声明
1. 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款。
2. 不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
3.延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议、版权声明和其他原作者
3.使用本软件时,由于它集成了众多第三方开源软件,请共同遵守这些开源软件的使用许可条款规定。
4. 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议、版权声明和其他原作者
规定需要包含的说明(请尊重原作者的著作权,不要删除或修改文件中的`Copyright``@author`信息)
更不要,全局替换源代码中的 jeesite 或 ThinkGem 等字样,否则你将违反本协议条款承担责任。
4. 您若套用本软件的一些代码或功能参考,请保留源文件中的版权和作者,需要在您的软件介绍明显位置
5. 您若套用本软件的一些代码或功能参考,请保留源文件中的版权和作者,需要在您的软件介绍明显位置
说明出处,举例:本软件基于 JeeSite 快速开发平台并附带链接http://jeesite.com
5. 任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
6. 如果你对本软件有改进,希望可以贡献给我们,共同进步。
7. 本项目已申请软件著作权,请尊重开源,感谢阅读。
8. 无用户数限制,无在线人数限制,放心使用。
6. 任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
7. 如果你对本软件有改进,希望可以贡献给我们,共同进步。
8. 本项目已申请软件著作权,请尊重开源,感谢阅读。
9. 无用户数限制,无在线人数限制,放心使用。
## 技术服务与支持
## 技术支持与服务
* 本软件免费,我们也提供了相应的收费服务,因为:
* 没有资金的支撑就很难得到发展,特别是一个好的产品,如果 JeeSite 帮助了您,请为我们点赞。支持我们,您可以获得更多回馈,我们会把公益事业做的更好,开放更多资源,回报社区和社会。请给我们一些动力吧,在此非常感谢已支持我们的朋友!
* **联系我们**:请访问技术支持服务页面:<https://jeesite.com/docs/support/>
* **联系我们**:请访问技术支持服务页面:<http://s.jeesite.com>
## 今后如何升级?

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.2-SNAPSHOT</version>
<version>5.12.1-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -249,6 +249,11 @@
<artifactId>spring-web</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>

View File

@@ -19,6 +19,7 @@ import java.security.*;
public class DigestUtils {
public static final String SHA1 = "SHA-1";
public static final String SHA256 = "SHA-256";
public static final String MD5 = "MD5";
public static final String SM3 = "SM3";

View File

@@ -154,7 +154,7 @@ public class EncodeUtils {
return null;
}
try {
return URLEncoder.encode(part, encoding);
return URLEncoder.encode(part, StringUtils.isNotBlank(encoding) ? encoding : EncodeUtils.UTF_8);
} catch (UnsupportedEncodingException e) {
throw ExceptionUtils.unchecked(e);
}
@@ -175,7 +175,7 @@ public class EncodeUtils {
return null;
}
try {
return URLDecoder.decode(part, encoding);
return URLDecoder.decode(part, StringUtils.isNotBlank(encoding) ? encoding : EncodeUtils.UTF_8);
} catch (UnsupportedEncodingException e) {
throw ExceptionUtils.unchecked(e);
}
@@ -192,7 +192,7 @@ public class EncodeUtils {
private static final List<Pattern> xssPatterns = ListUtils.newArrayList(
Pattern.compile("(<\\s*(script|link|style|iframe)([\\s\\S]*?)(>|<\\/\\s*\\1\\s*>))|(</\\s*(script|link|style|iframe)\\s*>)", Pattern.CASE_INSENSITIVE),
Pattern.compile("\\s*(href|src)\\s*=\\s*(\"\\s*(javascript|vbscript):[^\"]+\"|'\\s*(javascript|vbscript):[^']+'|(javascript|vbscript):[^\\s]+)\\s*(?=>)", Pattern.CASE_INSENSITIVE),
Pattern.compile("\\s*on[a-z]+\\s*=\\s*(\"[^\"]+\"|'[^']+'|[^\\s]+)\\s*(?=>)", Pattern.CASE_INSENSITIVE),
Pattern.compile("\\s*/?\\s*on[a-zA-Z]+\\s*=\\s*(['\"]?)(.*?)\\1(?=\\s|>|/>)", Pattern.CASE_INSENSITIVE),
Pattern.compile("(eval\\((.*?)\\)|expression\\((.*?)\\))", Pattern.CASE_INSENSITIVE),
Pattern.compile("^(javascript:|vbscript:)", Pattern.CASE_INSENSITIVE)
);
@@ -226,7 +226,6 @@ public class EncodeUtils {
// 如果开始不是HTMLXMLJOSN格式则再进行HTML的 "、<、> 转码。
if (!StringUtils.startsWithIgnoreCase(value, "<!--HTML-->") // HTML
&& !StringUtils.startsWithIgnoreCase(value, "<?xml ") // XML
&& !StringUtils.contains(value, "id=\"FormHtml\"") // JFlow
&& !(StringUtils.startsWith(value, "{") && StringUtils.endsWith(value, "}")) // JSON Object
&& !(StringUtils.startsWith(value, "[") && StringUtils.endsWith(value, "]")) // JSON Array
){
@@ -267,7 +266,8 @@ public class EncodeUtils {
"(?:')|(?:--)|(/\\*(?:.|[\\n\\r])*?\\*/)|((extractvalue|updatexml|if|mid|database|rand|user)([\\s]*?)\\()"
+ "|(\\b(select|update|and|or|delete|insert|trancate|substr|ascii|declare|exec|count|master|into"
+ "|drop|execute|case when|sleep|union|load_file)\\b)", Pattern.CASE_INSENSITIVE);
private static final Pattern orderByPattern = Pattern.compile("[a-z0-9_\\.\\, ]*", Pattern.CASE_INSENSITIVE);
private static final Pattern simplePattern = Pattern.compile("[a-z0-9_\\.\\, ]*", Pattern.CASE_INSENSITIVE);
private static final Pattern columnNamePattern = Pattern.compile("[a-z0-9_\\.`\"\\[\\]]*", Pattern.CASE_INSENSITIVE);
/**
* SQL过滤防止注入传入参数输入有select相关代码替换空。
@@ -284,8 +284,13 @@ public class EncodeUtils {
public static String sqlFilter(String text, String source){
if (text != null){
String value = text;
if ("orderBy".equals(source)) {
Matcher matcher = orderByPattern.matcher(value);
if (StringUtils.inString(source, "simple", "orderBy")) {
Matcher matcher = simplePattern.matcher(value);
if (!matcher.matches()) {
value = StringUtils.EMPTY;
}
} else if (StringUtils.inString(source, "columnName")) {
Matcher matcher = columnNamePattern.matcher(value);
if (!matcher.matches()) {
value = StringUtils.EMPTY;
}
@@ -304,4 +309,27 @@ public class EncodeUtils {
return null;
}
// 对邮箱和手机号进行安全处理
private static final Pattern emailPattern = Pattern.compile("([\\w\\W]?)([\\w\\W]+)([\\w\\W])(@[\\w\\W]+)");
private static final Pattern mobilePattern = Pattern.compile("(\\d{3})(\\d+)(\\d{3})");
/**
* 手机号码进行掩码处理
*/
public static String mobileMask(String mobile){
if (StringUtils.isBlank(mobile)){
return mobile;
}
return mobilePattern.matcher(mobile).replaceAll("$1****$3");
}
/**
* 对电子邮箱进行掩码处理
*/
public static String emailMask(String email){
if (StringUtils.isBlank(email)){
return email;
}
return emailPattern.matcher(email).replaceAll("$1****$3$4");
}
}

View File

@@ -0,0 +1,185 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.common.codec;
import com.jeesite.common.io.PropertiesUtils;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
/**
* RSA 加密解密工具类,非对称加密
* @author ThinkGem
*/
public class RsaUtils {
private static final String RSA = "RSA";
private static final String algorithm = "SHA256withRSA";
private static final boolean STORE_BASE64 = PropertiesUtils.getInstance()
.getPropertyToBoolean("encrypt.storeBase64", "false");
/**
* 生成 RSA 秘钥对
*/
public static String[] genKeys() {
try {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(RSA);
keyPairGenerator.initialize(1024);
KeyPair keyPair = keyPairGenerator.generateKeyPair();
PublicKey publicKey = keyPair.getPublic();
PrivateKey privateKey = keyPair.getPrivate();
return new String[]{
EncodeUtils.encodeBase64(publicKey.getEncoded()),
EncodeUtils.encodeBase64(privateKey.getEncoded()),
};
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
/**
* 将 Base64 公钥串,转化为公钥对象
* @author ThinkGem
*/
public static PublicKey toPublicKey(String publicKey) {
try {
KeyFactory keyFactory = KeyFactory.getInstance(RSA);
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(EncodeUtils.decodeBase64(publicKey));
return keyFactory.generatePublic(publicKeySpec);
} catch (InvalidKeySpecException | NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
/**
* 将 Base64 私钥串,转化为私钥对象
* @author ThinkGem
*/
public static PrivateKey toPrivateKey(String privateKey) {
try {
KeyFactory keyFactory = KeyFactory.getInstance(RSA);
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(EncodeUtils.decodeBase64(privateKey));
return keyFactory.generatePrivate(pkcs8EncodedKeySpec);
} catch (InvalidKeySpecException | NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
/**
* 公钥加密
* @author ThinkGem
*/
public static byte[] encode(byte[] input, PublicKey publicKey) {
try {
Cipher encryptCipher = Cipher.getInstance(RSA);
encryptCipher.init(Cipher.ENCRYPT_MODE, publicKey);
return encryptCipher.doFinal(input);
} catch (InvalidKeyException | NoSuchPaddingException | IllegalBlockSizeException |
NoSuchAlgorithmException | BadPaddingException e) {
throw new RuntimeException(e);
}
}
/**
* 公钥加密
* @author ThinkGem
*/
public static String encode(String input, PublicKey publicKey) {
if (STORE_BASE64) {
return EncodeUtils.encodeBase64(encode(input.getBytes(StandardCharsets.UTF_8), publicKey));
}
return EncodeUtils.encodeHex(encode(input.getBytes(StandardCharsets.UTF_8), publicKey));
}
/**
* 私钥解密
* @author ThinkGem
*/
public static byte[] decode(byte[] input, PrivateKey privateKey) {
return decodeImpl(input, privateKey);
}
private static byte[] decodeImpl(byte[] input, PrivateKey privateKey) {
try {
Cipher decryptCipher = Cipher.getInstance(RSA);
decryptCipher.init(Cipher.DECRYPT_MODE, privateKey);
return decryptCipher.doFinal(input);
} catch (InvalidKeyException | NoSuchPaddingException | IllegalBlockSizeException |
NoSuchAlgorithmException | BadPaddingException e) {
throw new RuntimeException(e);
}
}
/**
* 私钥解密
* @author ThinkGem
*/
public static String decode(String input, PrivateKey privateKey) {
if (STORE_BASE64) {
return new String(decode(EncodeUtils.decodeBase64(input), privateKey), StandardCharsets.UTF_8);
}
return new String(decode(EncodeUtils.decodeHex(input), privateKey), StandardCharsets.UTF_8);
}
/**
* 私钥签名
* @author ThinkGem
*/
public static byte[] sign(byte[] input, PrivateKey privateKey) {
try {
Signature sig = Signature.getInstance(algorithm);
sig.initSign(privateKey);
sig.update(input);
return sig.sign();
} catch (NoSuchAlgorithmException | SignatureException | InvalidKeyException e) {
throw new RuntimeException(e);
}
}
/**
* 私钥签名
* @author ThinkGem
*/
public static String sign(String input, PrivateKey privateKey) {
if (STORE_BASE64) {
return EncodeUtils.encodeBase64(sign(input.getBytes(StandardCharsets.UTF_8), privateKey));
}
return EncodeUtils.encodeHex(sign(input.getBytes(StandardCharsets.UTF_8), privateKey));
}
/**
* 公钥验签
* @author ThinkGem
*/
public static boolean verify(byte[] input, PublicKey publicKey, byte[] signature) {
try {
Signature sig = Signature.getInstance(algorithm);
sig.initVerify(publicKey);
sig.update(input);
return sig.verify(signature);
} catch (NoSuchAlgorithmException | SignatureException | InvalidKeyException e) {
throw new RuntimeException(e);
}
}
/**
* 公钥验签
* @author ThinkGem
*/
public static boolean verify(String input, PublicKey publicKey, String signature) {
if (STORE_BASE64) {
return verify(input.getBytes(StandardCharsets.UTF_8), publicKey, EncodeUtils.decodeBase64(signature));
}
return verify(input.getBytes(StandardCharsets.UTF_8), publicKey, EncodeUtils.decodeHex(signature));
}
}

View File

@@ -4,79 +4,11 @@
*/
package com.jeesite.common.codec;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
/**
* SHA-1 加密工具类,散列加密,不可逆加密
* @author ThinkGem
*/
public class Sha1Utils {
/**
* 生成随机的 Byte[] 作为 salt 密钥.
* @param numBytes byte数组的大小
*/
public static byte[] genSalt(int numBytes) {
return DigestUtils.genSalt(numBytes);
}
/**
* 生成随机的 Byte[] 作为 salt 密钥,返回 HEX 值
* @param numBytes byte 数组的大小
*/
public static String genSaltString(int numBytes) {
return DigestUtils.genSaltString(numBytes);
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static byte[] sha1(byte[] input) {
return DigestUtils.digest(input, DigestUtils.SHA1, null, 1);
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static String sha1(String input) {
return EncodeUtils.encodeHex(sha1(input.getBytes(StandardCharsets.UTF_8)));
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static byte[] sha1(byte[] input, byte[] salt) {
return DigestUtils.digest(input, DigestUtils.SHA1, salt, 1);
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static String sha1(String data, String salt) {
return EncodeUtils.encodeHex(sha1(data.getBytes(StandardCharsets.UTF_8), EncodeUtils.decodeHex(salt)));
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static byte[] sha1(byte[] input, byte[] salt, int iterations) {
return DigestUtils.digest(input, DigestUtils.SHA1, salt, iterations);
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static String sha1(String input, String salt, int iterations) {
return EncodeUtils.encodeHex(sha1(input.getBytes(StandardCharsets.UTF_8), EncodeUtils.decodeHex(salt), iterations));
}
/**
* 对文件进行 SHA-1 散列.
*/
public static byte[] sha1(InputStream input) throws IOException {
return DigestUtils.digest(input, DigestUtils.SHA1);
}
@Deprecated
public class Sha1Utils extends ShaUtils {
}

View File

@@ -0,0 +1,131 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.common.codec;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
/**
* SHA-1 和 SHA-256 加密工具类,散列加密,不可逆加密
* @author ThinkGem
*/
public class ShaUtils {
/**
* 生成随机的 Byte[] 作为 salt 密钥.
* @param numBytes byte数组的大小
*/
public static byte[] genSalt(int numBytes) {
return DigestUtils.genSalt(numBytes);
}
/**
* 生成随机的 Byte[] 作为 salt 密钥,返回 HEX 值
* @param numBytes byte 数组的大小
*/
public static String genSaltString(int numBytes) {
return DigestUtils.genSaltString(numBytes);
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static byte[] sha1(byte[] input) {
return DigestUtils.digest(input, DigestUtils.SHA1, null, 1);
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static String sha1(String input) {
return EncodeUtils.encodeHex(sha1(input.getBytes(StandardCharsets.UTF_8)));
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static byte[] sha1(byte[] input, byte[] salt) {
return DigestUtils.digest(input, DigestUtils.SHA1, salt, 1);
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static String sha1(String data, String salt) {
return EncodeUtils.encodeHex(sha1(data.getBytes(StandardCharsets.UTF_8), EncodeUtils.decodeHex(salt)));
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static byte[] sha1(byte[] input, byte[] salt, int iterations) {
return DigestUtils.digest(input, DigestUtils.SHA1, salt, iterations);
}
/**
* 对输入字符串进行 SHA-1 散列.
*/
public static String sha1(String input, String salt, int iterations) {
return EncodeUtils.encodeHex(sha1(input.getBytes(StandardCharsets.UTF_8), EncodeUtils.decodeHex(salt), iterations));
}
/**
* 对文件进行 SHA-1 散列.
*/
public static byte[] sha1(InputStream input) throws IOException {
return DigestUtils.digest(input, DigestUtils.SHA1);
}
/**
* 对输入字符串进行 SHA-256 散列.
*/
public static byte[] sha256(byte[] input) {
return DigestUtils.digest(input, DigestUtils.SHA256, null, 1);
}
/**
* 对输入字符串进行 SHA-256 散列.
*/
public static String sha256(String input) {
return EncodeUtils.encodeHex(sha256(input.getBytes(StandardCharsets.UTF_8)));
}
/**
* 对输入字符串进行 SHA-256 散列.
*/
public static byte[] sha256(byte[] input, byte[] salt) {
return DigestUtils.digest(input, DigestUtils.SHA256, salt, 1);
}
/**
* 对输入字符串进行 SHA-256 散列.
*/
public static String sha256(String data, String salt) {
return EncodeUtils.encodeHex(sha256(data.getBytes(StandardCharsets.UTF_8), EncodeUtils.decodeHex(salt)));
}
/**
* 对输入字符串进行 SHA-256 散列.
*/
public static byte[] sha256(byte[] input, byte[] salt, int iterations) {
return DigestUtils.digest(input, DigestUtils.SHA256, salt, iterations);
}
/**
* 对输入字符串进行 SHA-256 散列.
*/
public static String sha256(String input, String salt, int iterations) {
return EncodeUtils.encodeHex(sha256(input.getBytes(StandardCharsets.UTF_8), EncodeUtils.decodeHex(salt), iterations));
}
/**
* 对文件进行 SHA-256 散列.
*/
public static byte[] sha256(InputStream input) throws IOException {
return DigestUtils.digest(input, DigestUtils.SHA256);
}
}

View File

@@ -103,5 +103,9 @@ public class IOUtils extends org.apache.commons.io.IOUtils {
// ignore
}
}
@Deprecated
public IOUtils() {
// empty
}
}

View File

@@ -4,7 +4,6 @@
*/
package com.jeesite.common.io;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.SetUtils;
import com.jeesite.common.lang.ObjectUtils;
import com.jeesite.common.lang.StringUtils;
@@ -17,6 +16,8 @@ import org.springframework.core.io.Resource;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -35,10 +36,10 @@ public class PropertiesUtils {
// 默认加载的文件可通过继承覆盖若有相同Key优先加载后面的
public static final String[] DEFAULT_CONFIG_FILE = new String[]{
"classpath:application.yml", "classpath:config/application.yml",
"classpath:bootstrap.yml", "classpath:config/bootstrap.yml",
"file:application.yml", "file:config/application.yml",
"file:bootstrap.yml", "file:config/bootstrap.yml",
"classpath:config/application.yml", "classpath:application.yml",
"classpath:config/bootstrap.yml", "classpath:bootstrap.yml",
"file:config/application.yml", "file:application.yml",
"file:config/bootstrap.yml", "file:bootstrap.yml",
};
private static final Logger logger = PropertiesUtils.initLogger();
@@ -64,9 +65,7 @@ public class PropertiesUtils {
//configSet.add("classpath:config/jeesite.yml");
// 获取全局设置默认的配置文件(以下是支持环境配置的属性文件)
Set<String> set = SetUtils.newLinkedHashSet();
for (String configFile : DEFAULT_CONFIG_FILE){
set.add(configFile);
}
set.addAll(Arrays.asList(DEFAULT_CONFIG_FILE));
// 获取 spring.config.location 外部自定义的配置文件
String customConfigs = System.getProperty("spring.config.location");
if (StringUtils.isNotBlank(customConfigs)){
@@ -81,7 +80,7 @@ public class PropertiesUtils {
}
}
// 获取 spring.profiles.active 活动环境名称的配置文件
String[] configFiles = set.toArray(new String[set.size()]);
String[] configFiles = set.toArray(new String[0]);
String profiles = System.getProperty("spring.profiles.active");
if (StringUtils.isBlank(profiles)){
PropertiesUtils propsTemp = new PropertiesUtils(configFiles);
@@ -101,7 +100,7 @@ public class PropertiesUtils {
}
}
}
configFiles = configSet.toArray(new String[configSet.size()]);
configFiles = configSet.toArray(new String[0]);
logger.debug("Trying: {}", (Object)configFiles);
INSTANCE = new PropertiesUtils(configFiles);
}
@@ -115,12 +114,11 @@ public class PropertiesUtils {
Resource resource = ResourceUtils.getResource(location);
if (resource.exists()){
if (location.endsWith(".properties")){
try (InputStreamReader is = new InputStreamReader(resource.getInputStream(), EncodeUtils.UTF_8)){
try (InputStreamReader is = new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8)){
properties.load(is);
configSet.add(location);
} catch (IOException e) {
System.err.println("Load " + location + " failure.");
e.printStackTrace();
logger.error("Load {} failure.", location, e);
}
}
else if (location.endsWith(".yml")){
@@ -133,8 +131,7 @@ public class PropertiesUtils {
}
configSet.add(location);
} catch (Exception e) {
System.err.println("Load " + location + " failure.");
e.printStackTrace();
logger.error("Load {} failure.", location, e);
}
}
}
@@ -174,7 +171,7 @@ public class PropertiesUtils {
private static final Pattern p1 = Pattern.compile("\\$\\{.*?\\}");
/**
* 获取属性值取不到从System.getProperty()获取都取不到返回null
* 获取属性值取不到从System.getProperty和System.getenv获取都取不到返回null
*/
public String getProperty(String key) {
if (environment != null){
@@ -196,9 +193,10 @@ public class PropertiesUtils {
String systemProperty = System.getProperty(key);
if (systemProperty != null) {
return systemProperty;
}else{
return System.getenv(key);
}
}
return null;
}
/**
@@ -315,7 +313,6 @@ public class PropertiesUtils {
/**
* 设置环境属性
* @param environment
*/
public static void setEnvironment(Environment environment) {
PropertiesUtils.environment = environment;

View File

@@ -4,10 +4,11 @@
*/
package com.jeesite.common.lang;
import com.jeesite.common.utils.LocaleUtils;
import org.apache.commons.lang3.time.FastDateFormat;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.ParsePosition;
import java.util.Calendar;
import java.util.Date;
@@ -17,14 +18,14 @@ import java.util.Date;
* @version 2017-1-4
*/
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
private static final String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd HH", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM/dd HH", "yyyy/MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM.dd HH", "yyyy.MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM.dd HH", "yyyy.MM",
"yyyy年MM月dd日", "yyyy年MM月dd日 HH时mm分ss秒", "yyyy年MM月dd日 HH时mm分", "yyyy年MM月dd日 HH时", "yyyy年MM月",
"yyyyMMdd", "yyyyMM", "yyyy"};
"yyyyMMdd", "yyyyMM", "yyyy", "yyyy-MM-dd'T'HH:mm:ss'Z'"};
/**
* 得到日期字符串 转换格式yyyy-MM-dd
*/
@@ -45,15 +46,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static String formatDate(Date date, String pattern) {
String formatDate = null;
if (date != null){
// if (StringUtils.isNotBlank(pattern)) {
// formatDate = DateFormatUtils.format(date, pattern);
// } else {
// formatDate = DateFormatUtils.format(date, "yyyy-MM-dd");
// }
if (StringUtils.isBlank(pattern)) {
pattern = "yyyy-MM-dd";
}
formatDate = FastDateFormat.getInstance(pattern).format(date);
// formatDate = DateFormatUtils.format(date, "yyyy-MM-dd");
formatDate = FastDateFormat.getInstance(pattern,
LocaleUtils.getTimeZone(), LocaleUtils.getLocale()).format(date);
}
return formatDate;
}
@@ -77,7 +75,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
*/
public static String getDate(String pattern) {
// return DateFormatUtils.format(new Date(), pattern);
return FastDateFormat.getInstance(pattern).format(new Date());
return FastDateFormat.getInstance(pattern,
LocaleUtils.getTimeZone(), LocaleUtils.getLocale()).format(new Date());
}
/**
@@ -88,11 +87,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* @return
*/
public static String getDate(String pattern, int amont, int type) {
Calendar calendar = Calendar.getInstance();
Calendar calendar = Calendar.getInstance(LocaleUtils.getTimeZone(), LocaleUtils.getLocale());
calendar.setTime(new Date());
calendar.add(type, amont);
// return DateFormatUtils.format(calendar.getTime(), pattern);
return FastDateFormat.getInstance(pattern).format(calendar.getTime());
return FastDateFormat.getInstance(pattern,
LocaleUtils.getTimeZone(), LocaleUtils.getLocale()).format(calendar.getTime());
}
/**
@@ -138,17 +138,43 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
}
/**
* 日期型字符串转化为日期 格式 see to DateUtils#parsePatterns
* 日期型字符串转化为日期对象,使用默认格式集
*/
public static Date parseDate(Object str) {
if (str == null){
return null;
}
try {
return parseDate(str.toString(), parsePatterns);
} catch (ParseException e) {
String dateStr = str.toString();
if (StringUtils.isBlank(dateStr)){
return null;
}
return parseDate(dateStr, parsePatterns);
}
/**
* 日期型字符串转化为日期对象,指定日期解析格式
*/
public static Date parseDate(final String str, final String... parsePatterns) {
// try {
// return DateUtils.parseDate(str, Locale.getDefault(), parsePatterns);
// } catch (ParseException e) {
// return null;
// }
ParsePosition pos = new ParsePosition(0);
Calendar calendar = Calendar.getInstance(LocaleUtils.getTimeZone(), LocaleUtils.getLocale());
for (final String parsePattern : parsePatterns) {
FastDateFormat format = FastDateFormat.getInstance(parsePattern);
calendar.clear();
try {
if (format.parse(str, pos, calendar) && pos.getIndex() == str.length()) {
return calendar.getTime();
}
} catch (final IllegalArgumentException ignored) {
// leniency is preventing calendar from being set
}
pos.setIndex(0);
}
return null;
}
/**
@@ -228,7 +254,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* @return
*/
public static int getWeekOfYear(Date date){
Calendar cal = Calendar.getInstance();
Calendar cal = Calendar.getInstance(LocaleUtils.getTimeZone(), LocaleUtils.getLocale());
cal.setTime(date);
return cal.get(Calendar.WEEK_OF_YEAR);
}
@@ -242,7 +268,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
if (date == null){
return null;
}
Calendar calendar = Calendar.getInstance();
Calendar calendar = Calendar.getInstance(LocaleUtils.getTimeZone(), LocaleUtils.getLocale());
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
@@ -260,7 +286,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
if (date == null){
return null;
}
Calendar calendar = Calendar.getInstance();
Calendar calendar = Calendar.getInstance(LocaleUtils.getTimeZone(), LocaleUtils.getLocale());
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
@@ -315,5 +341,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
}
return new Date[]{beginDate, endDate};
}
@Deprecated
public DateUtils() {
// empty
}
}

View File

@@ -37,16 +37,19 @@ public class ExceptionUtils {
public static String getExceptionMessage(Throwable ex){
String message = null;
Throwable e = ex;
while (true){
if (e == null){
while (true) {
if (e == null) {
break;
}
if (StringUtils.startsWith(e.getMessage(), "msg:")){
if (StringUtils.startsWith(e.getMessage(), "msg:")) {
message = StringUtils.replace(e.getMessage(), "msg:", "");
break;
}else if ("com.jeesite.common.service.ServiceException"
.equals(e.getClass().getName())){
} else if ("com.jeesite.common.service.ServiceException".equals(e.getClass().getName())){
message = e.getMessage();
}
if (StringUtils.isNotBlank(message)){
if (e.getSuppressed() != null && e.getCause() != null){
ex.addSuppressed(e.getCause());
}
break;
}
e = e.getCause();

View File

@@ -119,5 +119,9 @@ public class NumberUtils extends org.apache.commons.lang3.math.NumberUtils {
}
return df.format(data);
}
@Deprecated
public NumberUtils() {
// empty
}
}

View File

@@ -73,14 +73,37 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
* 转换为 Long 类型
*/
public static Long toLong(final Object val) {
return toDouble(val).longValue();
if (val == null) {
return 0L;
}
try {
String str = val.toString();
if (StringUtils.isBlank(str)) {
return 0L;
}
if (StringUtils.contains(str, "*")) {
Long number = null, d = null;
for (String s : StringUtils.split(str, "*")) {
d = Long.parseLong(StringUtils.trim(s));
if (number == null) {
number = d;
} else {
number *= d;
}
}
return number;
}
return Long.parseLong(StringUtils.trim(str));
} catch (Exception e) {
return 0L;
}
}
/**
* 转换为 Integer 类型
*/
public static Integer toInteger(final Object val) {
return toDouble(val).intValue();
return toLong(val).intValue();
}
/**
@@ -153,8 +176,7 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
return null;
}
byte[] bytes = ObjectUtils.serialize(source);
Object target = ObjectUtils.unserialize(bytes);
return target;
return ObjectUtils.unserialize(bytes);
}
/**
@@ -341,5 +363,9 @@ public class ObjectUtils extends org.apache.commons.lang3.ObjectUtils {
// inputPool.free(input);
// }
// }
@Deprecated
public ObjectUtils() {
// empty
}
}

View File

@@ -415,5 +415,9 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
return name;
}
}
@Deprecated
public StringUtils() {
// empty
}
}

View File

@@ -9,9 +9,9 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.introspect.Annotated;
import com.fasterxml.jackson.databind.introspect.AnnotatedClass;
import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
import com.fasterxml.jackson.databind.module.SimpleModule;
@@ -20,6 +20,7 @@ import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.io.PropertiesUtils;
import com.jeesite.common.lang.DateUtils;
import org.apache.commons.lang3.LocaleUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -27,7 +28,6 @@ import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import java.io.IOException;
import java.lang.reflect.AnnotatedElement;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -50,67 +50,108 @@ public class JsonMapper extends ObjectMapper {
private static final class JsonMapperHolder {
private static final JsonMapper INSTANCE = new JsonMapper();
}
public JsonMapper() {
// Spring ObjectMapper 初始化配置,支持 @JsonView
new Jackson2ObjectMapperBuilder().configure(this);
// 日志类型格式化处理
this.setLocaleTimeZoneDateFormat();
// 为Null时不序列化
this.setSerializationInclusion(Include.NON_NULL);
// 允许单引号
this.configure(Feature.ALLOW_SINGLE_QUOTES, true);
// 允许不带引号的字段名称
this.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
// 设置默认时区
this.setDefaultTimeZone();
// 设置默认日期格式
this.setDefaultDateFormat();
// 遇到空值处理为空串
// 遇到空值处理为空串
this.enabledNullValueToEmpty();
// 设置输入时忽略在JSON字符串中存在但Java对象实际没有的属性
this.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
// Spring ObjectMapper 初始化配置,支持 @JsonView
new Jackson2ObjectMapperBuilder().configure(this);
}
/**
* 开启日期类型默认格式化
* 日志类型格式化处理
* @author ThinkGem
*/
public JsonMapper setDefaultTimeZone(){
public JsonMapper setLocaleTimeZoneDateFormat(){
this.setLocale(LocaleUtils.toLocale(PropertiesUtils.getInstance()
.getProperty("lang.defaultLocale", "zh_CN")));
this.setTimeZone(TimeZone.getTimeZone(PropertiesUtils.getInstance()
.getProperty("lang.defaultTimeZone", "GMT+08:00")));
return this;
}
/**
* 开启日期类型默认格式化
* @author ThinkGem
*/
public JsonMapper setDefaultDateFormat(){
this.setDateFormat(new SimpleDateFormat(PropertiesUtils.getInstance()
.getProperty("web.json.defaultDateFormat", "yyyy-MM-dd HH:mm:ss")));
this.setAnnotationIntrospector(new JacksonAnnotationIntrospector() {
private static final long serialVersionUID = 1L;
@Override
public Object findSerializer(Annotated a) {
if (a instanceof AnnotatedMethod) {
AnnotatedElement m = a.getAnnotated();
JsonFormat jf = m.getAnnotation(JsonFormat.class);
if (jf != null) {
return new JsonSerializer<Date>(){
@Override
public void serialize(Date value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
if (value != null){
jgen.writeString(DateUtils.formatDate(value, jf.pattern()));
}
}
};
AnnotatedMethod am = (AnnotatedMethod) a;
if (am.getRawReturnType() == Date.class) {
JsonFormat jf = am.getAnnotation(JsonFormat.class);
if (jf != null && StringUtils.containsAnyIgnoreCase(jf.pattern(), pattern)) {
return new JeeSiteJsonSerializer(jf.pattern());
}
return new JeeSiteJsonSerializer(null);
}
} else if (a instanceof AnnotatedClass) {
if (a.getRawType() == Date.class) {
return new JeeSiteJsonSerializer(null);
}
}
return super.findSerializer(a);
}
@Override
public Object findDeserializer(Annotated a) {
if (a instanceof AnnotatedMethod) {
AnnotatedMethod am = (AnnotatedMethod) a;
if (am.getParameterCount() > 0 && am.getParameterType(0).getRawClass() == Date.class) {
AnnotatedElement m = am.getAnnotated();
JsonFormat jf = m.getAnnotation(JsonFormat.class);
if (jf != null && StringUtils.containsAnyIgnoreCase(jf.pattern(), pattern)) {
return new JeeSiteJsonDeserializer(jf.pattern());
}
return new JeeSiteJsonDeserializer(null);
}
} else if (a instanceof AnnotatedClass) {
if (a.getRawType() == Date.class) {
return new JeeSiteJsonDeserializer(null);
}
}
return super.findDeserializer(a);
}
});
return this;
}
private static final String[] pattern = new String[] {"yyyy", "MM", "dd", "HH", "mm", "ss", "SSS"};
private static final class JeeSiteJsonSerializer extends JsonSerializer<Date> {
private final String pattern;
private JeeSiteJsonSerializer(String pattern) {
this.pattern = pattern;
}
@Override
public void serialize(Date value, JsonGenerator gen, SerializerProvider provider) throws IOException {
if (value != null){
if (StringUtils.isNotBlank(pattern)) {
gen.writeString(DateUtils.formatDate(value, pattern));
} else {
gen.writeString(DateUtils.formatDateTime(value));
}
}
}
}
private static final class JeeSiteJsonDeserializer extends JsonDeserializer<Date> {
private final String pattern;
private JeeSiteJsonDeserializer(String pattern) {
this.pattern = pattern;
}
@Override
public Date deserialize(JsonParser parser, DeserializationContext context) throws IOException {
if (StringUtils.isNotBlank(pattern)) {
return DateUtils.parseDate(parser.getText(), pattern);
} else {
return DateUtils.parseDate(parser.getText());
}
}
}
/**
* 开启将空值转换为空字符串
* @author ThinkGem
@@ -121,7 +162,7 @@ public class JsonMapper extends ObjectMapper {
public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
jgen.writeString(StringUtils.EMPTY);
}
});
});
return this;
}
@@ -152,7 +193,7 @@ public class JsonMapper extends ObjectMapper {
try {
return this.writeValueAsString(object);
} catch (IOException e) {
logger.warn("write to json string error:" + object, e);
logger.warn("write to json string error: {}", object, e);
return null;
}
}
@@ -166,7 +207,7 @@ public class JsonMapper extends ObjectMapper {
try {
return this.writerWithView(jsonView).writeValueAsString(object);
} catch (IOException e) {
logger.warn("write to json string error:" + object, e);
logger.warn("write to json string error: {}", object, e);
return null;
}
}
@@ -182,8 +223,8 @@ public class JsonMapper extends ObjectMapper {
* 反序列化POJO或简单Collection如List<String>.
* 如果JSON字符串为Null或"null"字符串, 返回Null.
* 如果JSON字符串为"[]", 返回空集合.
* 如需反序列化复杂Collection如List<MyBean>, 请使用fromJson(String,JavaType)
* @see #fromJson(String, JavaType)
* 如需反序列化复杂Collection如List<MyBean>, 请使用fromJson(String, Class)
* @see #fromJson(String, Class)
*/
public <T> T fromJsonString(String jsonString, Class<T> clazz) {
if (StringUtils.isEmpty(jsonString) || "<CLOB>".equals(jsonString)) {
@@ -192,7 +233,7 @@ public class JsonMapper extends ObjectMapper {
try {
return this.readValue(jsonString, clazz);
} catch (IOException e) {
logger.warn("parse json string error:" + jsonString, e);
logger.warn("parse json string error: {}", jsonString, e);
return null;
}
}
@@ -209,7 +250,7 @@ public class JsonMapper extends ObjectMapper {
try {
return (T) this.readValue(jsonString, javaType);
} catch (IOException e) {
logger.warn("parse json string error:" + jsonString, e);
logger.warn("parse json string error: {}", jsonString, e);
return null;
}
}
@@ -230,10 +271,8 @@ public class JsonMapper extends ObjectMapper {
public <T> T update(String jsonString, T object) {
try {
return (T) this.readerForUpdating(object).readValue(jsonString);
} catch (JsonProcessingException e) {
logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
} catch (Exception e) {
logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
logger.warn("update json string: {} to object: {} error.", jsonString, object, e);
}
return null;
}

View File

@@ -77,7 +77,6 @@ public class ReflectUtils {
//Method method = getAccessibleMethodByName(object, methodName, 0);
//if (method == null) { return; }
//Class<?> returnType = method.getReturnType();
System.out.println(object.getClass());
MethodAccess ma = MethodAccess.get(object.getClass());
Class<?> returnType = ma.getReturnTypes()[ma.getIndex(methodName)];
childObj = returnType.getDeclaredConstructor().newInstance();

View File

@@ -1,7 +1,5 @@
package com.jeesite.common.utils;
import org.apache.commons.lang3.StringUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@@ -11,11 +9,10 @@ import java.util.Map;
/**
* 身份证工具类
*
* @author June
* @version 1.0, 2010-06-17
* @version 2010-06-17
*/
public class IdcardUtils extends StringUtils {
public class IdcardUtils {
/** 中国公民身份证号码最小长度。 */
public static final int CHINA_ID_MIN_LENGTH = 15;

View File

@@ -0,0 +1,100 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.common.utils;
import com.jeesite.common.io.PropertiesUtils;
import com.jeesite.common.web.http.ServletUtils;
import org.springframework.context.i18n.TimeZoneAwareLocaleContext;
import org.springframework.core.NamedThreadLocal;
import org.springframework.web.servlet.LocaleContextResolver;
import javax.servlet.http.HttpServletRequest;
import java.util.Locale;
import java.util.TimeZone;
/**
* 本地化工具
* @author ThinkGem
* @version 2025-05-21
*/
public class LocaleUtils {
private static final Boolean LANG_ENABLED = PropertiesUtils.getInstance().getPropertyToBoolean("lang.enabled", "false");
private static final ThreadLocal<TimeZoneAwareLocaleContext> timeZoneAwareLocaleContext = new NamedThreadLocal<>("TimeZoneAwareLocaleContext");
private static LocaleContextResolver localeResolver;
/**
* 获取当前 Locale 对象,获取顺序:请求 -> 会话 -> Cookie -> lang.defaultLocale
*/
public static Locale getLocale() {
return getTimeZoneAwareLocaleContext().getLocale();
}
/**
* 获取当前 TimeZone 对象,获取顺序:请求 -> 会话 -> Cookie -> lang.defaultTimeZone
*/
public static TimeZone getTimeZone() {
return getTimeZoneAwareLocaleContext().getTimeZone();
}
/**
* 获取 TimeZoneAwareLocaleContext
*/
public static TimeZoneAwareLocaleContext getTimeZoneAwareLocaleContext() {
TimeZoneAwareLocaleContext context = timeZoneAwareLocaleContext.get();
if (context != null){
return context;
}
Locale locale;
TimeZone timeZone;
if (LANG_ENABLED && localeResolver != null){
HttpServletRequest request = ServletUtils.getRequest();
if (request != null){
context = (TimeZoneAwareLocaleContext)localeResolver.resolveLocaleContext(request);
}
}
if (context != null){
locale = context.getLocale();
timeZone = context.getTimeZone();
} else {
locale = Locale.getDefault();
timeZone = TimeZone.getDefault();
}
context = new TimeZoneAwareLocaleContext() {
@Override
public Locale getLocale() {
return locale;
}
@Override
public TimeZone getTimeZone() {
return timeZone;
}
};
setTimeZoneAwareLocaleContext(context);
return context;
}
/**
* 设置 TimeZoneAwareLocaleContext
*/
public static void setTimeZoneAwareLocaleContext(TimeZoneAwareLocaleContext context) {
timeZoneAwareLocaleContext.set(context);
}
/**
* 清理本地线程对象(请求结束时调用)
*/
public static void removeTimeZoneAwareLocaleContext() {
timeZoneAwareLocaleContext.remove();
}
/**
* 设置 LocaleContextResolver
*/
public static void setLocaleResolver(LocaleContextResolver localeResolver) {
LocaleUtils.localeResolver = localeResolver;
}
}

View File

@@ -0,0 +1,44 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.common.utils.excel.fieldtype;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
/**
* BigDecimal类型转换
* @author ThinkGem
* @version 2020-3-5
* @example fieldType = BigDecimalType.class
*/
public class BigDecimalType implements FieldType {
/**
* 获取对象值(导入)
*/
@Override
public Object getValue(String val) {
return new BigDecimal(val);
}
/**
* 获取对象值(导出)
*/
@Override
public String setValue(Object val) {
return val == null ? StringUtils.EMPTY : val.toString();
}
/**
* 获取对象值格式(导出)
*/
@Override
public String getDataFormat() {
return "0.00";
}
}

View File

@@ -2,14 +2,14 @@
* http://jeesite.com
*/
a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sortable {
color:#1890ff;
color:#1677ff;
}
.main-header .navbar {
background: #1890ff;
background: -webkit-gradient(linear, left bottom, right top, color-stop(0, #2684f5), color-stop(1, #1890ff));
background: -ms-linear-gradient(left, #2684f5, #1890ff);
background: -moz-linear-gradient(left top, #2684f5 0%, #1890ff 100%);
background: -o-linear-gradient(#1890ff, #2684f5);
background: #1677ff;
background: -webkit-gradient(linear, left bottom, right top, color-stop(0, #2684f5), color-stop(1, #1677ff));
background: -ms-linear-gradient(left, #2684f5, #1677ff);
background: -moz-linear-gradient(left top, #2684f5 0%, #1677ff 100%);
background: -o-linear-gradient(#1677ff, #2684f5);
}
.main-header .navbar .nav > li > a {
color: #ffffff;
@@ -54,10 +54,10 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
border-bottom: 0 solid transparent;
}
.main-header .logo:hover {
background-color: #1890ff;
background-color: #1677ff;
}
.main-header li.user-header {
background-color: #1890ff;
background-color: #1677ff;
}
.content-header {
background: transparent;
@@ -93,7 +93,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
background: #ffffff;
}
.sidebar-menu > li.active {
border-left-color: #1890ff;
border-left-color: #1677ff;
}
.sidebar-menu > li.active > a {
font-weight: 600;
@@ -154,7 +154,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
border-radius: 4px;
}
.skin-blue.layout-top-nav .main-header > .logo {
background-color: #1890ff;
background-color: #1677ff;
color: #ffffff;
border-bottom: 0 solid transparent;
}
@@ -164,7 +164,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.sidebar-menu {padding:0 8px 0 7px;}
.sidebar-menu li>a>.pull-right-container {left:0;}
.sidebar-menu .treeview-item.active>a {color:#1890ff;background-color:#e7f4ff;border-right:0;border-radius:6px;}
.sidebar-menu .treeview-item.active>a {color:#1677ff;background-color:#e7f4ff;border-right:0;border-radius:6px;}
.content-wrapper, .right-side, body {background-color:#f0f2f5;}
@@ -189,12 +189,13 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.select2-container--default .select2-results__option--highlighted[aria-selected],
.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover,
.pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover,
.wup_container .placeholder .webuploader-pick {background-color:#1890ff!important;border-color:#1890ff;}
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#1890ff;}
.wup_container .placeholder .webuploader-pick {background-color:#1677ff!important;border-color:#1677ff;}
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#1677ff;}
.form-unit {border-bottom:1px solid #eee;}
.form-unit:before {background-color:#1677ff;}
.box-main>.box-header {border-bottom-color:#eeeeee;}
.box-main>.box-header .box-title .fa {color:#1890ff;}
.box-main>.box-header .box-title .fa {color:#1677ff;}
.nav-tabs-custom>.nav-tabs>li.active {border-top-color:#3aa0ff;}
.form-control:focus,.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-search--dropdown .select2-search__field,

View File

@@ -2,17 +2,37 @@
* http://jeesite.com
*/
a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sortable {
color:#1890ff;
color:#1677ff;
}
.main-header .navbar {
background: #1890ff;
background: -webkit-gradient(linear, left bottom, right top, color-stop(0, #2684f5), color-stop(1, #1890ff));
background: -ms-linear-gradient(left, #2684f5, #1890ff);
background: -moz-linear-gradient(left top, #2684f5 0%, #1890ff 100%);
background: -o-linear-gradient(#1890ff, #2684f5);
background: #1677ff;
background: -webkit-gradient(linear, left bottom, right top, color-stop(0, #2684f5), color-stop(1, #1677ff));
background: -ms-linear-gradient(left, #2684f5, #1677ff);
background: -moz-linear-gradient(left top, #2684f5 0%, #1677ff 100%);
background: -o-linear-gradient(#1677ff, #2684f5);
}
.main-header .navbar .nav > li > a {
color: #ffffff;
margin: 4.5px 2px 0;
padding: 10px 13px;
border-radius: 6px;
}
.main-header .navbar .nav > li > a > i {
font-size: 16px;
vertical-align: bottom;
line-height: 20px;
}
.navbar-nav>.user-menu>.dropdown-menu {
margin-top: 7px;
border-radius: 6px;
}
.navbar-nav .treeview-menu,
.navbar-custom-menu>.navbar-nav>li>.dropdown-menu {
margin-top: 5px;
border-radius: 6px;
}
.navbar-nav .treeview-menu a {
border-radius: 6px;
}
.main-header .navbar .nav > li > a:hover,
.main-header .navbar .nav > li > a:active,
@@ -54,10 +74,10 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
border-bottom: 0 solid transparent;
}
.main-header .logo:hover {
background-color: #1890ff;
background-color: #1677ff;
}
.main-header li.user-header {
background-color: #1890ff;
background-color: #1677ff;
}
.content-header {
background: transparent;
@@ -93,7 +113,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
background: #ffffff;
}
.sidebar-menu > li.active {
border-left-color: #1890ff;
border-left-color: #1677ff;
}
.sidebar-menu > li.active > a {
font-weight: 600;
@@ -154,7 +174,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
border-radius: 4px;
}
.skin-blue.layout-top-nav .main-header > .logo {
background-color: #1890ff;
background-color: #1677ff;
color: #ffffff;
border-bottom: 0 solid transparent;
}
@@ -164,12 +184,12 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.sidebar-menu {padding:0 8px 0 7px;}
.sidebar-menu li>a>.pull-right-container {left:0;}
.sidebar-menu .treeview-item.active>a {color:#1890ff;background-color:#e7f4ff;border-right:0;border-radius:6px;}
.sidebar-menu .treeview-item.active>a {color:#1677ff;background-color:#e7f4ff;border-right:0;border-radius:6px;}
/* 页签添加内边距 */
.content-wrapper, .tabpanel_content, .tabpanel_content .html_content, body {background-color:#f0f2f5;}
.box-main, .nav-main, .ui-layout-pane, iframe {border-radius:5px;}
.tabpanel_content .html_content {padding:13px 14px 13px 15px;}
.tabpanel_content .html_content {padding:12px 14px 12px 15px;}
.tabpanel_tab_content {border-bottom:0;}
.ui-layout-resizer {background:none;}
.content {padding:0!important}
@@ -211,12 +231,13 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.select2-container--default .select2-results__option--highlighted[aria-selected],
.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover,
.pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover,
.wup_container .placeholder .webuploader-pick {background-color:#1890ff!important;border-color:#1890ff!important;}
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#1890ff;}
.wup_container .placeholder .webuploader-pick {background-color:#1677ff!important;border-color:#1677ff!important;}
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#1677ff;}
.form-unit {border-bottom:1px solid #eee;}
.form-unit:before {background-color:#1677ff;}
.box-main>.box-header {border-bottom-color:#eeeeee;}
.box-main>.box-header .box-title .fa {color:#1890ff;}
.box-main>.box-header .box-title .fa {color:#1677ff;}
.nav-tabs-custom>.nav-tabs>li.active {border-top-color:#3aa0ff;}
.form-control:focus,.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-search--dropdown .select2-search__field,

View File

@@ -192,6 +192,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.wup_container .placeholder .webuploader-pick {background-color:#1e5edb!important;border-color:#1e5edb!important;}
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#1e5edb;}
.form-unit {border-bottom:1px solid #eee;}
.form-unit:before {background-color:#1e5edb;}
.box-main>.box-header {border-bottom-color:#eeeeee;}
.box-main>.box-header .box-title .fa {color:#1e5edb;}
@@ -199,7 +200,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.form-control:focus,.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {border-color:#557bfa!important;box-shadow:0 0 0 2px rgba(24,80,236,.2);}
.select2-container--default.select2-container--focus .select2-selection--multiple {border-color:#557bfa!important;box-shadow:0 0 0 2px rgba(5, 88, 255, 0.06);}
.table thead tr, .ui-jqgrid-htable thead tr, .ui-jqgrid-hdiv, .ui-jqgrid-hbox {background-color:#f6f6f6;}
.ui-jqgrid .ui-jqgrid-labels th, .ui-jqgrid tr.ui-row-ltr td, .ui-jqgrid tr.ui-row-rtl td, .ui-jqgrid tr.ui-row-ltr td:last-child,
.ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column,

View File

@@ -13,6 +13,26 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
}
.main-header .navbar .nav > li > a {
color: #ffffff;
margin: 4.5px 2px 0;
padding: 10px 13px;
border-radius: 6px;
}
.main-header .navbar .nav > li > a > i {
font-size: 16px;
vertical-align: bottom;
line-height: 20px;
}
.navbar-nav .treeview-menu,
.navbar-nav>.user-menu>.dropdown-menu {
margin-top: 7px;
border-radius: 6px;
}
.navbar-custom-menu>.navbar-nav>li>.dropdown-menu {
margin-top: 5px;
border-radius: 6px;
}
.navbar-nav .treeview-menu a {
border-radius: 6px;
}
.main-header .navbar .nav > li > a:hover,
.main-header .navbar .nav > li > a:active,
@@ -169,7 +189,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
/* 页签添加内边距 */
.content-wrapper, .tabpanel_content, .tabpanel_content .html_content, body {background-color:#f0f2f5;}
.box-main, .nav-main, .ui-layout-pane, iframe {border-radius:5px;}
.tabpanel_content .html_content {padding:13px 14px 13px 15px;}
.tabpanel_content .html_content {padding:12px 14px 12px 15px;}
.tabpanel_tab_content {border-bottom:0;}
.ui-layout-resizer {background:none;}
.content {padding:0!important}
@@ -214,6 +234,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.wup_container .placeholder .webuploader-pick {background-color:#1e5edb!important;border-color:#1e5edb!important;}
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#1e5edb;}
.form-unit {border-bottom:1px solid #eee;}
.form-unit:before {background-color:#1e5edb;}
.box-main>.box-header {border-bottom-color:#eeeeee;}
.box-main>.box-header .box-title .fa {color:#1e5edb;}
@@ -221,7 +242,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.form-control:focus,.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {border-color:#557bfa!important;box-shadow:0 0 0 2px rgba(24,80,236,.2);}
.select2-container--default.select2-container--focus .select2-selection--multiple {border-color:#557bfa!important;box-shadow:0 0 0 2px rgba(5, 88, 255, 0.06);}
.table thead tr, .ui-jqgrid-htable thead tr, .ui-jqgrid-hdiv, .ui-jqgrid-hbox {background-color:#fafafa;}
.ui-jqgrid .ui-jqgrid-labels th, .ui-jqgrid tr.ui-row-ltr td, .ui-jqgrid tr.ui-row-rtl td, .ui-jqgrid tr.ui-row-ltr td:last-child,
.ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column,

View File

@@ -167,7 +167,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
/* 页签添加内边距 */
.content-wrapper, .tabpanel_content, .tabpanel_content .html_content, body {background-color:#000;}
.box-main, .nav-main, .ui-layout-pane, iframe {border-radius:5px;}
.tabpanel_content .html_content {padding:13px 14px 13px 15px;}
.tabpanel_content .html_content {padding:12px 14px 12px 15px;}
.tabpanel_tab_content {border-bottom:0;}
.ui-layout-resizer {background:none;}
.content {padding:0!important}
@@ -203,7 +203,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
::-webkit-scrollbar {background:#2a2a2a;}
::-webkit-scrollbar-thumb {background:#6a6a6a;}
.btn-default {background-color:#323232;border-color:#323232;color:#b5b5b5;}
.btn-default {background-color:#323232;border-color:#323232;color:#b5b5b5;} .btn-default i {color:#dfdfdf;}
.btn-default.active, .btn-default:active {background-color:#3e3e3e;border-color:#3e3e3e;color:#dfdfdf;}
.btn-default:hover, .btn-default:active, .btn-default.hover, .btn-default:focus,
.btn-default.active.focus, .btn-default.active:focus, .btn-default.active:hover, .btn-default:active.focus,
@@ -227,6 +227,7 @@ a, a:hover, a:active, a:focus, .form-unit, th[aria-selected=true] .ui-jqgrid-sor
.wup_container .placeholder .webuploader-pick {background-color:#3aa0ff!important;border-color:#3aa0ff!important;}
.form-unit, th[aria-selected=true] .ui-jqgrid-sortable {color:#2975bc;}
.form-unit {border-bottom:1px solid #4e4e4e;}
.form-unit:before {background-color:#2975bc;}
.form-inline .form-more {background-color:#1a1a1a;border-bottom-color:#393939;}
.form-control, .input-group .input-group-addon, input, select, textarea, pre {background-color:#1a1a1a;border-color:#414141!important;color:#ddd}

View File

@@ -435,7 +435,7 @@
},
getNodeTitle: function(setting, node) {
var t = setting.data.key.title === "" ? setting.data.key.name : setting.data.key.title;
return "" + node[t];
return "" + (node[t] || node[setting.data.key.name]);
},
getNodes: function(setting) {
return data.getRoot(setting)[setting.data.key.children];

View File

@@ -434,7 +434,7 @@
},
getNodeTitle: function(setting, node) {
var t = setting.data.key.title === "" ? setting.data.key.name : setting.data.key.title;
return "" + node[t];
return "" + (node[t] || node[setting.data.key.name]);
},
getNodes: function(setting) {
return data.getRoot(setting)[setting.data.key.children];

View File

@@ -1,170 +0,0 @@
=ZTree v3.x (JQuery Tree插件) 更新日志=
<font color="red">为了更好的优化及扩展zTree, 因此决定升级为v3.x并且对之前的v2.x不兼容会有很多结构上的修改对此深感无奈与抱歉请大家谅解。</font>
<font color="red">
具体修改内容可参考:
* [http://www.ztree.me/v3/api.php zTree v3.0 API 文档]
* [http://www.ztree.me/v3/demo.php#_101 zTree v3.0 Demo 演示]
* [http://www.ztree.me/v3/faq.php#_101 zTree v3.0 常见问题]
</font>
<font color=#041594>
*2013.03.11* v3.5.12
* 【修改】由于 jquery 1.9 中移除 event.srcElement 导致的 js 报错的bug。
* 【修改】在异步加载模式下,使用 moveNode 方法,且 moveType != "inner" 时,也会导致 targetNode 自动加载子节点的 bug
* 【修改】对已经显示的节点(nochecked=true)使用 showNodes 或 showNode 方法后导致勾选框出现的bug。
* 【修改】对已经隐藏的节点(nochecked=false)使用 hideNodes 或 hideNode 方法后导致勾选框消失的bug。
* 【修改】getNodesByParamFuzzy 支持 大小写模糊。
* 【修改】className 结构,提取 _consts.className.BUTTON / LEVEL / ICO_LOADING / SWITCH便于快速修改 css 冲突。
例如:与 WordPress 产生冲突后,直接修改 core 中的 "button" 和 "level" 即可。 Issue: https://github.com/zTree/zTree_v3/issues/2
*2013.01.28* v3.5.02
* 【增加】setting.check.chkDisabledInherit 属性,用于设置 chkDisabled 在初始化时子节点是否可以继承父节点的 chkDisabled 属性
* 【删除】内部 noSel 方法,使用 selectstart事件 和 "-moz-user-select"样式 处理禁止 节点文字被选择的功能
* 【修改】不兼容 jQuery 1.9 的bug
* 【修改】onDrop 的触发规则,保证异步加载模式下,可以在延迟加载结束后触发,避免 onDrop 中被拖拽的节点是已经更新后的数据。
* 【修改】setChkDisabled 方法,增加 inheritParent, inheritChildren 参数设置是否让父子节点继承 disabled
* 【修改】异步加载时 拼接参数的方法,由 string 修改为 json 对象
* 【修正】1-2-3 3级节点时如果 2级节点 全部设置为 nocheck 或 chkDisabled后勾选3级节点时1级节点的半勾选状态错误的 bug
* 【修改】Demo: checkbox_nocheck.html & checkbox_chkDisabled.html;
* 【修改】Demo: edit_super.html增加 showRenameBtn & showRemoveBtn 的演示
* 【修改】Demo: asyncForAll, 将 post 修改为 get为了避免由于 IE10 的 bug 造成的客户端 以及 服务端崩溃
IE10 ajax Post 无法提交参数的bug (http://bugs.jquery.com/ticket/12790)
*2012.12.21* v3.5.01
* 【优化】clone 方法
* 【修正】对于初始化无 children 属性的父节点进行 reAsyncChildNodes 操作时出错的 bug
* 【修正】beforeRename 回调中使用 cancelEditName 方法后,再 return false 导致无法重新进行编辑的 bug
* 【修正】exedit 扩展包让 setting.data.key.url 失效的 bug
* 【修正】setting.check.autoCheckTrigger 设置为 true 时onCheck 回调缺少 event 参数的 bug
* 【修正】singlepath.html Demo 中的 bug
*2012.11.20* v3.5
* 【优化】原先的 clone 方法 (特别感谢:愚人码头)
* 【修改】隐藏父节点后,使用 expandAll 方法导致 父节点展开的 bug
* 【修改】使用 jQuery v1.7 以上时,设置 zTree 容器 ul 隐藏visibility: hidden;)后, 调用 selectNode 导致 IE 浏览器报错 Can't move focus 的 bug
* 【修改】正在异步加载时,执行 destory 或 init 方法后,异步加载的节点影响新树的 bug
* 【修改】方法 reAsyncChildNodes 在 refresh 的时候未清空内部 cache 导致内存泄露 的 bug
* 【修改】批量节点拖拽到其他父节点内inner导致顺序反转 的 bug
* 【修改】对于 使用 html格式的 节点无法触发 双击事件 的 bug
* 【修改】onCheck 回调中的 event ,保证与触发事件中的 event 一致
* 【修改】异步加载时,在 onNodeCreated 中执行 selectNode 后,导致节点折叠的 bug
* 【修改】API 中 dataFilter 的参数名称 childNodes -> responseData
* 【修改】API 中 iconSkin 的 举例内容
* 【修改】API 中 chkDisabled 的说明
* 【修改】Demo 中 index.html 内的 loadReady 重复绑定问题
*2012.09.03* v3.4
* 【增加】 Demo —— OutLook 样式的左侧菜单
* 【增加】清空 zTree 的方法 $.fn.zTree.destory(treeId) & zTree.destory()
* 【修改】core核心文件内 _eventProxy 方法中获取 tId 的方法,提高 DOM 的灵活性
* 【修改】初始化时 多层父节点的 checkbox 半选状态计算错误的 bug
* 【修改】同时选中父、子节点后,利用 getSelectedNodes 获取选中节点并利用 removeNode 删除时报错的 bug
* 【修改】treeNode.chkDisabled / nocheck 属性,支持字符串格式的 "false"/"true"
* 【修改】异步加载模式下无法利用 server 返回 xml 并且 在 dataFilter 中继续处理的 bug
* 【修改】title 只允许设置为 string 类型值的问题。 修正后允许设置为 number 类型的值
* 【修改】zId 计数规则 & Cache 保存,减少 IE9 的 bug 造成的内存泄漏
* 【修改】API 页面搜索功能导致 IE 崩溃的 bug
*2012.07.16* v3.3
* 【增加】扩展库 exhide -- 节点隐藏功能
* 【修改】getNodesByFilter 方法,添加 invokeParam 自定义参数
* 【修改】拖拽中测试代码未删除,导致出现黄颜色的 iframe 遮罩层的 bug
* 【修改】延迟加载方法 对于使用 expandAll 进行全部展开时,导致 onNodeCreated 回调 和 addDiyDom 方法触发过早的 bug
* 【修改】使用 moveNode 移动尚未生成 DOM 的节点时,视图会出现异常的 bug
* 【修改】删除节点后,相关节点的 isFirstNode 属性未重置的 bug
* 【修改】getPreNode(),getNextNode() 方法在对于特殊情况时计算错误的 bug
* 【修改】设置 title 之后,如果重新将 title 内容设置为空后,会导致无法更新 title 的 bug
* 【修改】针对 setting.check.chkStyle=="radio" && setting.check.radioType=="all" 的情况时getTreeCheckedNodes方法优化找到一个结果就 break
* 【修改】zTreeObj.getCheckedNodes(false) 在 radioType = "all" 时计算错误的 bug
* 【修改】完善 API 中 beforeDrop / onDrop 的关于 treeId 的说明
*2012.05.13* v3.2
* 【增加】setting.data.key.url 允许修改 treeNode.url 属性
* 【增加】getNodesByFilter(filter, isSingle) 方法
* 【增加】"与其他 DOM 拖拽互动" 的 Demo (http://www.ztree.me/v3/demo.php#_511)
* 【增加】"异步加载模式下全部展开" 的 Demo (http://www.ztree.me/v3/demo.php#_512)
* 【修改】代码结构,将 addNodes、removeNode、removeChildNodes 方法 和 beforeRemove、onRemove 回调 转移到 core 内
* 【修改】IE7的环境下无子节点的父节点反复展开出现多余空行的 bug
* 【修改】异步加载时,如果出现网络异常等,会导致 图标显示错误的 bug
* 【修改】dataFilter中 return null 导致异常 的 bug
* 【修改】removeChildNodes 方法清空子节点后,无法正常添加节点的 bug
* 【修改】moveNode 后节点中的自定义元素的事件丢失的 bug
* 【修改】moveNode 方法中设置 isSilent = true 时,如果移动到已展开的 父节点后,出现异常的 bug
* 【修改】onClick/onDrag/onDrop 回调中 event 不是原始 event 的 bug
* 【修改】onDrop 回调中 当拖拽无效时,无法获得 treeNodes 的 bug
* 【修改】onDrop 无法判断拖拽是 移动还是复制的问题
* 【修改】未开启异步加载模式时,拖拽节点到子节点为空的父节点内时 出现异常 的 bug
* 【修改】拖拽过程中,反复在 父节点图标上划动时,会出现停顿的 bug
(需要css 结构—— button -> span.button)
* 【修改】拖拽操作时箭头 与 targetNode 背景之间的细节现实问题,便于用户拖拽时更容易区分 prev、next 和 inner 操作
* 【修改】拖拽操作时IE6/7 下 在 节点<a> 右侧 10px 内会导致 targetNode = root 的 bug
* 【修改】编辑模式下 默认的编辑按钮、删除按钮点击后,如果相应的 before 回调 return false 时会触发 onClick 回调的 bug
*2012.02.14* v3.1
* 【增加】ajax 的参数 setting.async.contentType ,让提交参数适用于 json 数据提交 (主要适用于 .Net 的开发)。
* 【增加】setting.edit.editNameSelectAll, 用于设定编辑节点名称时初次显示 input 后 text 内容为全选
* 【修改】异步加载 规则,不再仅仅依靠父节点的子节点数来判定,增加内部属性 zAsync保证默认状态下父节点及时无子节点也只能异步加载一次除非使用 reAsyncChildNodes 方法强行控制异步加载。
* 【修改】放大浏览器后导致 界面出现多余连接线的bug 需要更新icon 图标和 css
* 【修改】在编辑状态如果节点名超过编辑框宽度左右键在框内不起作用的bugIE 6 7 8 出现)
CSS 中 filter:alpha(opacity=80) 造成的,应该是 ie 的 bug需要更新 css 文件
* 【修改】title 设置后,如果属性不存在,则默认为 title 为空,便于数据容错和用户灵活使用
* 【修改】editName 方法如果针对尚未展开的 父节点,会导致该父节点自动展开的 bug
* 【修改】title 中存在标签时导致 title 显示异常的bug例如蓝色字22%"'`<input/>`
*2012.01.10* v3.0
* 【增加】setting.check.autoCheckTrigger 默认值 false可以设置联动选中时是否触发事件回调函数
* 【增加】setting.callback.beforeEditName 回调函数,以保证用户可以捕获点击编辑按钮的事件
* 【增加】treeNode.chkDisabled 属性,显示 checkbox 但是用户无法修改 checkbox 状态,并且该 checkbox 会影响父节点的 checkbox 的半选状态
* 【增加】setting.check.nocheckInherit 属性,用户设置子节点继承 nocheck 属性,用于批量初始化节点,不适用于已经显示的节点
* 【增加】setting.edit.drag.autoExpandTrigger 默认值 false可以设置自动展开、折叠操作时是否触发事件回调函数
* 【增加】setting.view.nameIsHTML 默认值 false允许用户对 name 设置 DOM 对象
* 【增加】treeNode.click 属性的说明文档
* 【增加】treeObj.setChkDisabled 方法用于设置 checkbox / radio disabled 状态
* 【增加】treeNode.halfCheck 属性,用于强制设定节点的半选状态
* 【修改】异步加载 & 编辑功能 共存时,拖拽节点 或 增加节点 导致 ie 上报错的 bug apply 方法引起)
* 【修改】zTreeStyle 样式冲突
* 【修改】setting.data.key.title 默认值设置为 "",初始化时自动赋值为 setting.data.key.name 这样可避免希望 title 与 name 一致的用户反复设置参数
* 【修改】点击叶子节点的连接线会触发 expand 事件的 bug
* 【修改】IE 下 点击叶子节点连线会出现虚线框的 bug
* 【修改】updateNode 导致 checkbox 半选状态错误的 bug
* 【修改】checkNode 方法实现 toggle 操作, 取消 expandAll 方法的 toggle 操作
* 【修改】zTree 内鼠标移动会抢页面上 input 内的焦点的 bug
* 【修改】beforeRename / onRename 的触发方式——即使名称内容未改变也会触发,便于用户配合 beforeEditName 捕获编辑状态的结束,赋予用户更多调整规则的权利
* 【修改】与 easyUI 共存时无法拖拽的bug
* 【修改】beforeRename 在 Firefox 下如果利用 alert会触发两次的 bug
* 【修改】checkNode/expandNode/removeNode 方法,默认不触发回调函数,恢复 v2.6 的默认状态,同时增加 callbackFlag 参数,设置为 true 时,可以触发回调函数
* 【修改】IE9下“根据参数查找节点”的Demo 报错行14 重新声明常量属性(Demo 自身的问题定义了history变量)
* 【修改】初始化 zTree 时 onNodeCreated 事件回调函数中无法 用 getZTreeObj 获取 zTree 对象的 bug
* 【修改】setting.edit.drag.prev / next / inner 参数,增加被拖拽的节点集合
* 【修改】异步加载模式下otherParam 使用Array数组会出错的 bug。例如 ["id", "1", "name", "test"]
* 【修改】FireFox 下多棵树拖拽异常的 bug
* 【修改】exedit 中调用 excheck库的方法时没有进行容错处理导致如果只加入 exedit 而没有 excheck的时候会出现 js 错误
* 【修改】显示 checkbox 的 zTree 在编辑模式下,移动节点不会更新父节点半选状态的 bug
* 【修改】treeNode.childs --> children; treeObject.removeChilds --> removeChildNodes; setting.data.key.childs --> children英文不好惹的祸抱歉了
* 【修改】onRemove 回调中得到的 treeNode 还可以查找 preNode、nextNode 的bug。 修正后getPreNode 和 getNextNode 都返回 null 为了便于查找父节点getParentNode 仍保留
* 【修改】简单数据模式下,如果 id 与 pId 的值相同会导致该节点无法正常加载的 bug
* 【修改】移动或删除中间节点会导致最后一个节点连接线图标变小的 bug
*2011.09.05* v3.0 beta
* 【修改】zTree 的 js 代码架构全面修改,并且拆分
* 【修改】zTree 的 css 样式全面修改对浏览器可以更好地兼容同时解决了以前1个像素差的问题
* 【优化】采用延迟加载技术,一次性加载大数据量的节点性能飞速提升
* 【增加】支持多节点同时选中、拖拽
* 【增加】checkNode、checkAllNodes 等多种方法
* 【增加】IE6 自动取消动画展开、折叠的功能
* 【修正】异步加载 & 编辑模式 能够更完美的共存
* 【修正】setting 配置更加合理,并且增加了若干项配置参数
* 【修正】treeNode 节点数据的属性更加合理,并且增加了一些方法
* 【修正】拖拽操作更加灵活方便,更容易制定自己的规则
* 【修正】其他若干修改,详细对比请参考 url[http://www.ztree.me/v3/faq.php#_101 zTree v3.0 常见问题]

View File

@@ -14,37 +14,49 @@ import com.jeesite.common.codec.EncodeUtils;
public class EncodeUtilsTest {
public static void main(String[] args) {
EncodeUtils.xssFilter("1 你好 <script>alert(document.cookie)</script>我还在。");
EncodeUtils.xssFilter("2 你好 <strong>加粗文字</strong>我还在。");
EncodeUtils.xssFilter("<!--HTML-->3 你好 \"><strong>加粗文字</strong>我还在。");
EncodeUtils.xssFilter("<!--HTML-->4 你好 <iframe src=\"abcdef\"></iframe><strong>加粗文字</strong>我还在。");
EncodeUtils.xssFilter("<!--HTML-->5 你好 <iframe src=\"abcdef\"/><strong>加粗文字</strong>我还在。");
EncodeUtils.xssFilter("<!--HTML-->6 你好 <iframe src=\"abcdef\"><strong>加粗文字</strong>我还在。");
EncodeUtils.xssFilter("<!--HTML-->7 你好 <script type=\"text/javascript\">alert(document.cookie)</script>我还在。");
EncodeUtils.xssFilter("<!--HTML-->8 你好 <script\n type=\"text/javascript\">\nalert(document.cookie)\n</script>我还在。");
EncodeUtils.xssFilter("<!--HTML-->9 你好 <script src='' onerror='alert(document.cookie)'></script>我还在。");
EncodeUtils.xssFilter("<!--HTML-->10 你好 <script type=text/javascript>alert()我还在。");
EncodeUtils.xssFilter("<!--HTML-->11 你好 <script>alert(document.cookie)</script>我还在。");
EncodeUtils.xssFilter("<!--HTML-->12 你好 <script>window.location='url'我还在。");
EncodeUtils.xssFilter("<!--HTML-->13 你好 </script></iframe>我还在。");
EncodeUtils.xssFilter("<!--HTML-->14 你好 eval(abc)我还在。");
EncodeUtils.xssFilter("<!--HTML-->15 你好 expression(abc)我还在。");
EncodeUtils.xssFilter("<!--HTML-->16 你好 <img src='abc.jpg' onerror='location='';alert(document.cookie);'></img>我还在。");
EncodeUtils.xssFilter("<!--HTML-->17 你好 <img src='abc.jpg' onerror='alert(document.cookie);'/>我还在。");
EncodeUtils.xssFilter("<!--HTML-->18 你好 <img src='abc.jpg' onerror='alert(document.cookie);'>我还在。");
EncodeUtils.xssFilter("<!--HTML-->19 你好 <a onload='alert(\"abc\")'>hello</a>我还在。");
EncodeUtils.xssFilter("<!--HTML-->20 你好 <a href=\"/abc\">hello</a>我还在。");
EncodeUtils.xssFilter("<!--HTML-->21 你好 <a href='/abc'>hello</a>我还在。");
EncodeUtils.xssFilter("<!--HTML-->22 你好 <a href='vbscript:alert(\"abc\");'>hello</a>我还在。");
EncodeUtils.xssFilter("<!--HTML-->23 你好 <a href='javascript:alert(\"abc\");'>hello</a>我还在。");
EncodeUtils.xssFilter("<!--HTML-->24 你好 ?abc=def&hello=123&world={\"a\":1}我还在。");
EncodeUtils.xssFilter("<!--HTML-->25 你好 ?abc=def&hello=123&world={'a':1}我还在。");
EncodeUtils.sqlFilter("1 你好 select * from xxx where abc=def and 1=1我还在。");
EncodeUtils.sqlFilter("2 你好 insert into xxx values(1,2,3,4,5)我还在。");
EncodeUtils.sqlFilter("3 你好 delete from xxx我还在。");
EncodeUtils.sqlFilter("4 a.audit_result asc,case when 1 like case when length(database())=6 then 1 else exp(111) end then 1 else 1/0 end", "orderBy");
EncodeUtils.sqlFilter("5 if(1=2,1,SLEEP(10)), if(mid(database(),{},1)=\\\"{}\\\",a.id,a.login_name)", "orderBy");
EncodeUtils.sqlFilter("6 a.audit_result asc, b.audit_result2 desc, b.AuditResult3 desc", "orderBy");
int i = 0;
xssFilter(i++, "你好 <script>alert(document.cookie)</script>我还在。");
xssFilter(i++, "你好 <strong>加粗文字</strong>我还在。");
xssFilter(i++, "<!--HTML-->你好 \"><strong>加粗文字</strong>我还在。");
xssFilter(i++, "<!--HTML-->你好 <iframe src=\"abcdef\"></iframe><strong>加粗文字</strong>我还在。");
xssFilter(i++, "<!--HTML-->你好 <iframe src=\"abcdef\"/><strong>加粗文字</strong>我还在。");
xssFilter(i++, "<!--HTML-->你好 <iframe src=\"abcdef\"><strong>加粗文字</strong>我还在。");
xssFilter(i++, "<!--HTML-->你好 <script type=\"text/javascript\">alert(document.cookie)</script>我还在。");
xssFilter(i++, "<!--HTML-->你好 <script\n type=\"text/javascript\">\nalert(document.cookie)\n</script>我还在。");
xssFilter(i++, "<!--HTML-->你好 <script src='' onerror='alert(document.cookie)'></script>我还在。");
xssFilter(i++, "<!--HTML-->你好 <script type=text/javascript>alert()我还在。");
xssFilter(i++, "<!--HTML-->你好 <script>alert(document.cookie)</script>我还在。");
xssFilter(i++, "<!--HTML-->你好 <script>window.location='url'我还在。");
xssFilter(i++, "<!--HTML-->你好 </script></iframe>我还在。");
xssFilter(i++, "<!--HTML-->你好 eval(abc)我还在。");
xssFilter(i++, "<!--HTML-->你好 expression(abc)我还在。");
xssFilter(i++, "<!--HTML-->你好 <img src='abc.jpg' onerror='location='';alert(document.cookie);'></img>我还在。");
xssFilter(i++, "<!--HTML-->你好 <img src='abc.jpg' onerror='alert(document.cookie);'/>我还在。");
xssFilter(i++, "<!--HTML-->你好 <img src='abc.jpg' onerror='alert(document.cookie);'>我还在。");
xssFilter(i++, "<!--HTML-->你好 <a onload='alert(\"abc\")'>hello</a>我还在。");
xssFilter(i++, "<!--HTML-->你好 <a href=\"/abc\">hello</a>我还在。");
xssFilter(i++, "<!--HTML-->你好 <a href='/abc'>hello</a>我还在。");
xssFilter(i++, "<!--HTML-->你好 <a href='vbscript:alert(\"abc\");'>hello</a>我还在。");
xssFilter(i++, "<!--HTML-->你好 <a href='javascript:alert(\"abc\");'>hello</a>我还在。");
xssFilter(i++, "<!--HTML-->你好 ?abc=def&hello=123&world={\"a\":1}我还在。");
xssFilter(i++, "<!--HTML-->你好 ?abc=def&hello=123&world={'a':1}我还在。");
xssFilter(i++, "<!--HTML-->\"><svg/ONLOAD=confirm(3) />");
sqlFilter(i++, "你好 select * from xxx where abc=def and 1=1我还在。", "common");
sqlFilter(i++, "你好 insert into xxx values(1,2,3,4,5)我还在。", "common");
sqlFilter(i++, "你好 delete from xxx我还在。", "common");
sqlFilter(i++, "a.audit_result asc,case when 1 like case when length(database())=6 then 1 else exp(111) end then 1 else 1/0 end", "orderBy");
sqlFilter(i++, "if(1=2,1,SLEEP(10)), if(mid(database(),{},1)=\\\"{}\\\",a.id,a.login_name)", "orderBy");
sqlFilter(i++, "a.audit_result asc, b.audit_result2 desc, b.AuditResult3 desc", "orderBy");
}
private static void xssFilter(int num, String text) {
String text2 = EncodeUtils.xssFilter(text);
System.out.println(num + ". " + text + "\t ==> \t" + text2 + "\t ==> \t" + text.equals(text2));
}
private static void sqlFilter(int num, String text, String source) {
String text2 = EncodeUtils.sqlFilter(text, source);
System.out.println(num + ". " + text + "\t ==> \t" + text2 + "\t ==> \t" + text.equals(text2));
}
}

View File

@@ -0,0 +1,46 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.test.codec;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.codec.RsaUtils;
import java.nio.charset.StandardCharsets;
import java.security.PrivateKey;
import java.security.PublicKey;
/**
* RSA 加密解密工具类,非对称加密
* @author ThinkGem
*/
public class RsaUtilsTest {
public static void main(String[] args) {
String s = "Hello word! 你好,中文!";
System.out.println(s);
String[] keys = RsaUtils.genKeys();
System.out.println("公钥:" + keys[0]);
PublicKey publicKey = RsaUtils.toPublicKey(keys[0]);
System.out.println("私钥:" + keys[1]);
PrivateKey privateKey = RsaUtils.toPrivateKey(keys[1]);
byte[] data = RsaUtils.encode(s.getBytes(), publicKey);
String dataString = EncodeUtils.encodeBase64(data);
System.out.println("加密数据:" + dataString);
byte[] data2 = RsaUtils.decode(data, privateKey);
String dataString2 = new String(data2, StandardCharsets.UTF_8);
System.out.println("解密数据:" + dataString2);
byte[] sign = RsaUtils.sign(s.getBytes(), privateKey);
System.out.println("数据签名:" + EncodeUtils.encodeBase64(sign));
boolean b = RsaUtils.verify(s.getBytes(), publicKey, sign);
System.out.println("数据验签:" + b);
}
}

View File

@@ -1,28 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.test.codec;
import com.jeesite.common.codec.Sha1Utils;
/**
* SHA-1 加密工具类,散列加密,不可逆加密
* @author ThinkGem
* @version 2024-07-22
*/
public class Sha1UtilsTest {
public static void main(String[] args) {
String s = "Hello word! 你好,中文!";
System.out.println(s);
String salt = Sha1Utils.genSaltString(8);
System.out.println(salt);
String data = Sha1Utils.sha1(s, salt);
System.out.println(data);
}
}

View File

@@ -0,0 +1,36 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.test.codec;
import com.jeesite.common.codec.ShaUtils;
/**
* SHA-1 加密工具类,散列加密,不可逆加密
* @author ThinkGem
* @version 2024-07-22
*/
public class ShaUtilsTest {
public static final int HASH_ITERATIONS = 1024;
public static final int SALT_SIZE = 8;
public static void main(String[] args) {
String s = "Hello word! 你好,中文!";
System.out.println(s);
String salt = ShaUtils.genSaltString(SALT_SIZE);
System.out.println(salt);
String data = ShaUtils.sha1(s, salt, HASH_ITERATIONS);
System.out.println(data);
String salt2 = ShaUtils.genSaltString(SALT_SIZE);
System.out.println(salt2);
String data2 = ShaUtils.sha256(s, salt2, HASH_ITERATIONS);
System.out.println(data2);
}
}

View File

@@ -18,6 +18,7 @@ public class DateUtilsTest {
public static void main(String[] args) throws ParseException {
System.out.println(DateUtils.formatDate(DateUtils.parseDate("2023/3/6")));
System.out.println(DateUtils.formatDateTime(DateUtils.parseDate("2023-3-6 12:30:15")));
System.out.println(DateUtils.getDate("yyyy年MM月dd日 E"));
long time = new Date().getTime()-DateUtils.parseDate("2023-11-19").getTime();
System.out.println(time/(24*60*60*1000));

View File

@@ -0,0 +1,26 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.test.lang;
import com.jeesite.common.lang.ObjectUtils;
import java.text.ParseException;
/**
* 对象操作工具测试类
* @author ThinkGem
* @version 2025-02-05
*/
public class ObjectUtilsTest {
public static void main(String[] args) throws ParseException {
String str = "1738746499603094500";
System.out.println(ObjectUtils.toDouble(str));
System.out.println(ObjectUtils.toFloat(str));
System.out.println(ObjectUtils.toLong(str));
System.out.println(ObjectUtils.toInteger(str));
}
}

View File

@@ -8,6 +8,7 @@ import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.mapper.JsonMapper;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -30,6 +31,7 @@ public class JsonMapperTest {
map.put("pId", 1);
map.put("name", "你好");
map.put("open", true);
map.put("date", new Date());
list.add(map);
String json = JsonMapper.toJson(list);
System.out.println(json);

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.2-SNAPSHOT</version>
<version>5.12.1-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

View File

@@ -24,13 +24,14 @@ import java.util.Date;
@Column(name="category", attrName="category", label="问题分类"),
@Column(name="content", attrName="content", label="问题和意见"),
@Column(name="contact", attrName="contact", label="联系方式"),
@Column(includeEntity=DataEntity.class),
@Column(name="create_by_name", attrName="createByName", label="提问人员姓名", queryType=QueryType.LIKE),
@Column(name="device_info", attrName="deviceInfo", label="设备信息"),
@Column(name="reply_date", attrName="replyDate", label="回复时间"),
@Column(name="reply_content", attrName="replyContent", label="回复意见"),
@Column(name="reply_user_code", attrName="replyUserCode", label="回复人员"),
@Column(name="reply_user_name", attrName="replyUserName", label="回复人员姓名", queryType=QueryType.LIKE),
@Column(name="status", attrName="status", label="状态", isUpdate=true), // save时允许更新status字段
@Column(includeEntity=DataEntity.class),
}, orderBy="a.create_date DESC"
)
public class AppComment extends DataEntity<AppComment> {

View File

@@ -4,11 +4,11 @@
*/
package com.jeesite.modules.app.web;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.app.entity.AppComment;
import com.jeesite.modules.app.service.AppCommentService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,11 +20,9 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.app.entity.AppComment;
import com.jeesite.modules.app.service.AppCommentService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
/**
* APP意见反馈Controller
@@ -97,7 +95,6 @@ public class AppCommentController extends BaseController {
}
}
appCommentService.save(appComment);
appCommentService.updateStatus(appComment);
return renderResult(Global.TRUE, text("保存意见成功!"));
}

View File

@@ -22,4 +22,10 @@
5.8.1
5.9.0
5.9.1
5.9.2
5.9.2
5.10.0
5.10.1
5.11.0
5.11.1
5.12.0
5.12.1

View File

@@ -8,9 +8,9 @@
<div class="box-tools pull-right">
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
<% if(hasPermi('app:appComment:edit')){ %>
<a href="${ctx}/app/appComment/form" class="btn btn-default btnTool" title="${text('新增意见')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<a href="${ctx}/app/appComment/form" class="btn btn-primary btnTool" title="${text('新增意见')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<% } %>
<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
<a href="#" class="btn-setting" id="btnSetting" title="${text('设置')}"><i class="fa icon-settings"></i></a>
</div>
</div>
<div class="box-body">
@@ -82,11 +82,11 @@ $('#dataGrid').dataGrid({
{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
var actions = [];
//# if(hasPermi('app:appComment:edit')){
actions.push('<a href="${ctx}/app/appComment/form?id='+row.id+'" class="btnList" title="${text("编辑意见")}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/app/appComment/form?id='+row.id+'" class="btnList" title="${text("编辑意见")}"><i class="fa icon-note"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/app/appComment/disable?id='+row.id+'" class="btnList" title="${text("停用意见")}" data-confirm="${text("确认要停用该意见吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/app/appComment/disable?id='+row.id+'" class="btnList" title="${text("停用意见")}" data-confirm="${text("确认要停用该意见吗?")}"><i class="fa icon-ban"></i></a>&nbsp;');
} else if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/app/appComment/enable?id='+row.id+'" class="btnList" title="${text("启用意见")}" data-confirm="${text("确认要启用该意见吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/app/appComment/enable?id='+row.id+'" class="btnList" title="${text("启用意见")}" data-confirm="${text("确认要启用该意见吗?")}"><i class="fa icon-check"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/app/appComment/delete?id='+row.id+'" class="btnList" title="${text("删除意见")}" data-confirm="${text("确认要删除该意见吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
//# }

View File

@@ -8,9 +8,9 @@
<div class="box-tools pull-right">
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
<% if(hasPermi('app:appUpgrade:edit')){ %>
<a href="${ctx}/app/appUpgrade/form" class="btn btn-default btnTool" title="${text('新增版本')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<a href="${ctx}/app/appUpgrade/form" class="btn btn-primary btnTool" title="${text('新增版本')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<% } %>
<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
<a href="#" class="btn-setting" id="btnSetting" title="${text('设置')}"><i class="fa icon-settings"></i></a>
</div>
</div>
<div class="box-body">
@@ -82,11 +82,11 @@ $('#dataGrid').dataGrid({
{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
var actions = [];
//# if(hasPermi('app:appUpgrade:edit')){
actions.push('<a href="${ctx}/app/appUpgrade/form?id='+row.id+'" class="btnList" title="${text("编辑版本")}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/app/appUpgrade/form?id='+row.id+'" class="btnList" title="${text("编辑版本")}"><i class="fa icon-note"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/app/appUpgrade/disable?id='+row.id+'" class="btnList" title="${text("停用版本")}" data-confirm="${text("确认要停用该版本吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/app/appUpgrade/disable?id='+row.id+'" class="btnList" title="${text("停用版本")}" data-confirm="${text("确认要停用该版本吗?")}"><i class="fa icon-ban"></i></a>&nbsp;');
} else if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/app/appUpgrade/enable?id='+row.id+'" class="btnList" title="${text("启用版本")}" data-confirm="${text("确认要启用该版本吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/app/appUpgrade/enable?id='+row.id+'" class="btnList" title="${text("启用版本")}" data-confirm="${text("确认要启用该版本吗?")}"><i class="fa icon-check"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/app/appUpgrade/delete?id='+row.id+'" class="btnList" title="${text("删除版本")}" data-confirm="${text("确认要删除该版本吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
//# }

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.2-SNAPSHOT</version>
<version>5.12.1-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -24,6 +24,12 @@
<artifactId>jeesite-module-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
</dependencies>

View File

@@ -61,7 +61,7 @@ import java.util.Date;
@Column(name = "site_code"),
@Column(name = "site_name"),
})
}, orderBy = "a.update_date DESC", extWhereKeys = "dsfCategory"
}, orderBy = "a.weight DESC, a.update_date DESC"
)
public class Article extends DataEntity<Article> {

View File

@@ -28,23 +28,28 @@ import java.util.List;
@Column(name = "category_code", attrName = "categoryCode", label = "栏目编码", isPK = true),
@Column(name = "category_name", attrName = "categoryName", label = "栏目名称", queryType = QueryType.LIKE, isTreeName = true),
@Column(name = "site_code", attrName = "site.siteCode", label = "站点编码", queryType = QueryType.EQ),
@Column(name = "module_type", attrName = "moduleType", label = "模块类型"), @Column(name = "image", attrName = "image", label = "栏目图片"),
@Column(name = "href", attrName = "href", label = "链接"), @Column(name = "target", attrName = "target", label = "目标"),
@Column(name = "keywords", attrName = "keywords", label = "关键字"), @Column(name = "description", attrName = "description", label = "描述"),
@Column(name = "in_menu", attrName = "inMenu", label = "是否在导航中显示"), @Column(name = "in_list", attrName = "inList", label = "是否在分类页中显示列表"),
@Column(name = "module_type", attrName = "moduleType", label = "模块类型"),
@Column(name = "image", attrName = "image", label = "栏目图片"),
@Column(name = "href", attrName = "href", label = "链接"),
@Column(name = "target", attrName = "target", label = "目标"),
@Column(name = "keywords", attrName = "keywords", label = "关键字"),
@Column(name = "description", attrName = "description", label = "描述"),
@Column(name = "in_menu", attrName = "inMenu", label = "是否在导航中显示"),
@Column(name = "in_list", attrName = "inList", label = "是否在分类页中显示列表"),
@Column(name = "show_modes", attrName = "showModes", label = "展现模式"),
@Column(name = "is_need_audit", attrName = "isNeedAudit", label = "是否需要审核"),
@Column(name = "is_can_comment", attrName = "isCanComment", label = "是否允许评论"),
@Column(name = "custom_list_view", attrName = "customListView", label = "自定义列表视图"),
@Column(name = "custom_content_view", attrName = "customContentView", label = "自定义内容视图"),
@Column(name = "view_config", attrName = "viewConfig", label = "视图配置"), @Column(includeEntity = DataEntity.class),
@Column(name = "view_config", attrName = "viewConfig", label = "视图配置"),
@Column(includeEntity = DataEntity.class),
@Column(includeEntity = Extend.class, attrName = "extend"),
}, joinTable = {
@JoinTable(entity = Site.class, alias = "s",
on = "s.site_code = a.site_code", columns = {
@Column(name = "site_name"),
})
}, orderBy = "a.tree_sorts, a.category_code", extWhereKeys = "dsfCategory"
}, orderBy = "a.tree_sorts, a.category_code"
)
public class Category extends TreeEntity<Category> {
@@ -109,6 +114,14 @@ public class Category extends TreeEntity<Category> {
this.categoryCode = categoryCode;
}
public String getCategoryCode_like() {
return sqlMap().getWhere().getValue("category_code", QueryType.LIKE);
}
public void setCategoryCode_like(String categoryCode) {
sqlMap().getWhere().and("category_code", QueryType.LIKE, categoryCode);
}
@NotBlank(message = "栏目名称不能为空")
@Size(min = 0, max = 100, message = "栏目名称长度不能超过 100 个字符")
public String getCategoryName() {

View File

@@ -29,7 +29,7 @@ import java.util.List;
@Column(name = "site_sort", attrName = "siteSort", label = "站点排序号"),
@Column(name = "title", attrName = "title", label = "站点标题", queryType = QueryType.LIKE),
@Column(name = "logo", attrName = "logo", label = "站点Logo"),
@Column(name = "domain_name", attrName = "domain", label = "站点域名"),
@Column(name = "domain_name", attrName = "domain", label = "站点域名", queryType = QueryType.LIKE),
@Column(name = "keywords", attrName = "keywords", label = "关键字"),
@Column(name = "description", attrName = "description", label = "描述"),
@Column(name = "theme", attrName = "theme", label = "主题"),

View File

@@ -0,0 +1,81 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.cms.properties.properties;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* CmsProperties
* @author ThinkGem
* @version 2022-4-10
*/
@ConfigurationProperties(prefix = "cms")
public class CmsProperties {
private PageCache pageCache = new PageCache();
public static class PageCache {
/**
* 是否开启页面静态化缓存
*/
private Boolean enabled = false;
/**
* 缓存名称标识
*/
private String cacheName = "cmsPageCache";
/**
* 拦截的网页地址
*/
private String urlPatterns = "${frontPath}/*";
/**
* 只静态化 .html 后缀的网页
*/
private String urlSuffixes = ".html";
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public String getCacheName() {
return cacheName;
}
public void setCacheName(String cacheName) {
this.cacheName = cacheName;
}
public String getUrlPatterns() {
return urlPatterns;
}
public void setUrlPatterns(String urlPatterns) {
this.urlPatterns = urlPatterns;
}
public String getUrlSuffixes() {
return urlSuffixes;
}
public void setUrlSuffixes(String urlSuffixes) {
this.urlSuffixes = urlSuffixes;
}
}
public PageCache getPageCache() {
return pageCache;
}
public void setPageCache(PageCache pageCache) {
this.pageCache = pageCache;
}
}

View File

@@ -4,16 +4,16 @@
*/
package com.jeesite.modules.cms.utils;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import org.springframework.core.io.Resource;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.SetUtils;
import com.jeesite.common.io.ResourceUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.modules.cms.entity.FileTemplete;
import org.springframework.core.io.Resource;
import java.io.IOException;
import java.util.List;
import java.util.Set;
/**
* 模板文件公共类库
@@ -26,7 +26,10 @@ public class FileTempleteUtils {
* 获取模版文件
* @param fileName
*/
public static FileTemplete getFileTempleteByResource(String fileName) throws IOException {
public static FileTemplete getFileTempleteByResource(String fileName) {
if (!StringUtils.startsWith(fileName, "views/modules/cmsfront")) {
fileName = "views/modules/cmsfront/themes/default/index.html";
}
Resource resource = ResourceUtils.getResource(fileName);
return new FileTemplete(resource, fileName);
}

View File

@@ -16,7 +16,6 @@ import com.jeesite.modules.cms.entity.Site;
import com.jeesite.modules.cms.service.CategoryService;
import com.jeesite.modules.cms.service.FileTempleteService;
import com.jeesite.modules.cms.utils.CmsUtils;
import com.jeesite.modules.sys.entity.Office;
import com.jeesite.modules.sys.utils.DictUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -29,6 +28,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -52,10 +52,23 @@ public class CategoryController extends BaseController {
* 获取数据
*/
@ModelAttribute
public Category get(String categoryCode, boolean isNewRecord) {
public Category get(String categoryCode, boolean isNewRecord, HttpServletRequest request) {
if (StringUtils.endsWith(request.getRequestURI(), "listData")) {
return new Category();
}
return categoryService.get(categoryCode, isNewRecord);
}
/**
* 管理主页
*/
@RequiresPermissions("cms:category:view")
@RequestMapping(value = "index")
public String index(Category category, Model model) {
model.addAttribute("category", category);
return "modules/cms/categoryIndex";
}
/**
* 查询列表
*/
@@ -78,17 +91,18 @@ public class CategoryController extends BaseController {
@ResponseBody
public List<Category> listData(Category category) {
if (StringUtils.isBlank(category.getParentCode())) {
category.setParentCode(Office.ROOT_CODE);
category.setParentCode(Category.ROOT_CODE);
}
if (StringUtils.isBlank(category.getSite().getSiteCode())) {
category.setSite(new Site(Site.getCurrentSiteCode()));
}
List<Category> list = null;
if (StringUtils.isNotBlank(category.getCategoryCode())) {
list = ListUtils.newArrayList(get(category.getCategoryCode(), false));
} else {
list = categoryService.findList(category);
if (StringUtils.isNotBlank(category.getCategoryCode())
|| StringUtils.isNotBlank(category.getCategoryCode_like())
|| StringUtils.isNotBlank(category.getCategoryName())
|| StringUtils.isNotBlank(category.getRemarks())) {
category.setParentCode(null);
}
List<Category> list = categoryService.findList(category);
return list;
}
@@ -212,7 +226,7 @@ public class CategoryController extends BaseController {
public String disable(Category category) {
Category where = new Category();
where.setStatus(Category.STATUS_NORMAL);
where.setParentCodes("," + category.getId() + ",");
where.setParentCodes_rightLike(category.getParentCodes() + category.getId() + ",");
long count = categoryService.findCount(where);
if (count > 0) {
return renderResult(Global.FALSE, text("该栏目表包含未停用的子栏目表!"));

View File

@@ -0,0 +1,12 @@
## 重要提示Tip
## 请勿在该配置文件中添加其它任何配置(添加也不会生效)。
## 该文件,仅仅是为了让 jeesite-cms.yml 文件,
## 在 IDEA 中有一个自动完成及帮助提示,并无其它用意。
## 参数配置请在 jeesite-cms.yml 文件中添加。
spring:
config:
import:
- classpath:config/jeesite-cms.yml

View File

@@ -12,10 +12,10 @@ IMPORT_PACKAGE_cms=\
#FNP.strutil = org.beetl.ext.fn.StringUtil
##内置的格式化函数
#FT.dateFormat = org.beetl.ext.format.DateFormat
#FT.dateFormat = com.jeesite.common.beetl.ext.format.DateFormat
##内置的默认格式化函数
#FTC.java.util.Date = org.beetl.ext.format.DateFormat
#FTC.java.util.Date = com.jeesite.common.beetl.ext.format.DateFormat
## 标签类
#TAG.include= org.beetl.ext.tag.IncludeTag

View File

@@ -3,7 +3,7 @@
cms:
pageCache:
# 是否开启页面静态化缓存
#enabled: true
enabled: false
# 缓存名称标识
cacheName: cmsPageCache
# 拦截的网页地址

View File

@@ -30,4 +30,10 @@
5.8.1
5.9.0
5.9.1
5.9.2
5.9.2
5.10.0
5.10.1
5.11.0
5.11.1
5.12.0
5.12.1

View File

@@ -4,6 +4,10 @@ body>.navbar{-webkit-transition:background-color .3s ease-in;transition:backgrou
body>.navbar-transparent{background-color:transparent}
body>.navbar-transparent .navbar-nav>.open>a{background-color:transparent!important}
}
h1,.h1{font-size:26px}
h2,.h2{font-size:24px}
h3,.h3{font-size:22px}
p{margin:5px 0 10px;line-height:1.75;}
#home{padding-top:0}
#home .navbar-brand{padding:13.5px 15px 12.5px}
#home .navbar-brand>img{display:inline;margin:0 10px;height:100%}
@@ -80,7 +84,7 @@ footer p{clear:left;margin-bottom:0}
.article-title {color:#333;font-size:30px;text-align:center;border-bottom:1px solid #ddd;padding:15px 20px 20px 20px;margin-bottom:30px;}
.article-info {border-top:1px solid #ddd;padding:10px;margin:30px 0 0;}
.article-desc {padding:8px 10px 8px;margin:10px 20px 20px 35px;font-size:14px;}
.article-content {padding-top:20px;}
.article-content {padding-top:10px;}
.pagination {margin:8px 0;display:block;/* text-align:center; */font-size:13px;} /* .pagination .controls a{border:0;} */
.pagination>li>a, .pagination>li>span {min-width:37px;text-align:center;padding:6px;border:1px solid #ddd;background:transparent;/* border-radius:3px; */}

View File

@@ -1210,7 +1210,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
@@ -1255,7 +1255,7 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Source Code</h4>
</div>
<div class="modal-body">

View File

@@ -6,10 +6,10 @@
<i class="fa icon-note"></i> ${text('内容管理')}
</div>
<div class="box-tools pull-right">
<a href="${ctxFront}/index" target="_blank" class="btn btn-default" title="${text('访问站点')}"><i class="fa fa-globe"></i> ${text('访问网站')}</a>
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
<a href="${ctxFront}/index" target="_blank" class="btn btn-default" title="${text('访问站点')}"><i class="fa fa-globe"></i> ${text('访问网站')}</a>
<% if(hasPermi('cms:article:edit')){ %>
<a href="${ctx}/cms/article/form" onclick="$(this).data('href', this.href+'?category.categoryCode='+$('#categoryCode').val())" class="btn btn-default btnTool" title="${text('新增文章')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<a href="${ctx}/cms/article/form" onclick="$(this).data('href', this.href+'?category.categoryCode='+$('#categoryCode').val())" class="btn btn-primary btnTool" title="${text('新增文章')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<% } %>
</div>
</div>
@@ -71,12 +71,12 @@ $('#dataGrid').dataGrid({
{header:'${text("操作")}', name:'actions', width:150, formatter: function(val, obj, row, act){
var actions = [];
//# if(hasPermi('cms:article:edit')){
actions.push('<a href="${ctx}/cms/article/form?id='+row.id+'" class="btnList" title="${text("编辑文章")}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/article/form?id='+row.id+'" class="btnList" title="${text("编辑文章")}"><i class="fa icon-note"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/cms/article/disable?id='+row.id+'" class="btnList" title="${text("停用文章")}" data-confirm="${text("确认要停用该文章吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/article/disable?id='+row.id+'" class="btnList" title="${text("停用文章")}" data-confirm="${text("确认要停用该文章吗?")}"><i class="fa icon-ban"></i></a>&nbsp;');
}
if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/cms/article/enable?id='+row.id+'" class="btnList" title="${text("启用文章")}" data-confirm="${text("确认要启用该文章吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/article/enable?id='+row.id+'" class="btnList" title="${text("启用文章")}" data-confirm="${text("确认要启用该文章吗?")}"><i class="fa icon-check"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/cms/article/delete?id='+row.id+'" class="btnList" title="${text("删除文章")}" data-confirm="${text("确认要删除该文章吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){

View File

@@ -0,0 +1,78 @@
<% layout('/layouts/default.html', {title: '栏目管理', libs: ['layout','zTree']}){ %>
<div class="ui-layout-west">
<div class="main-content">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-grid"></i> ${text('栏目导航')}
</div>
<div class="box-tools pull-right">
<% if(hasPermi('bpm:bpmCategory:edit')){ %>
<button type="button" class="btn btn-box-tool addTabPage" data-href="${ctx}/cms/category/list" title="${text('栏目管理')}"><i class="fa fa-edit"></i></button>
<% } %>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="${text('展开')}" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="${text('折叠')}"><i class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="${text('刷新')}"><i class="fa fa-refresh"></i></button>
</div>
</div>
<div class="ui-layout-content">
<div id="tree" class="ztree"></div>
</div>
</div>
</div>
</div>
<div class="ui-layout-center">
<iframe id="mainFrame" name="mainFrame" class="ui-layout-content p0"
src="${ctx}/cms/category/list"></iframe>
</div>
<% } %>
<script>
//# // 初始化布局
$('body').layout({
west__initClosed: $(window).width() <= 767, // 是否默认关闭
west__size: 190
});
//# // 主页框架
var win = $("#mainFrame")[0].contentWindow;
//# // 树结构初始化加载
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{enable:true}},
async:{enable:true,autoParam:["id=parentCode"],url:"${ctx}/cms/category/treeData"},
callback:{onClick:function(event, treeId, treeNode){
tree.expandNode(treeNode);
//win.$('button[type=reset]').click();
win.$('#categoryCode').val(treeNode.id);
win.page(1);
}}
}, tree, loadTree = function(){
js.ajaxSubmit(setting.async.url+"?___t="+new Date().getTime(), {
parentCode:'${parameter.parentCode!}'}, function(data){
tree = $.fn.zTree.init($("#tree"), setting, data);
var level = -1, nodes;
while (++level <= 1) {
nodes = tree.getNodesByParam("level", level);
if (nodes.length > 10) { break; }
for(var i=0; i<nodes.length; i++) {
tree.expandNode(nodes[i], true, false, false);
}
}
}, null, null, js.text('loading.message'));
};loadTree();
//# // 工具栏按钮绑定
$('#btnExpand').click(function(){
tree.expandAll(true);
$(this).hide();
$('#btnCollapse').show();
});
$('#btnCollapse').click(function(){
tree.expandAll(false);
$(this).hide();
$('#btnExpand').show();
});
$('#btnRefresh').click(function(){
loadTree();
});
//调用子页分页函数
function page(){
win.page();
}
</script>

View File

@@ -24,7 +24,7 @@
<a href="#" class="btn btn-default" id="btnExpandTreeNode" title="${text('展开一级')}"><i class="fa fa-angle-double-down"></i>${text('展开')}</a>
<a href="#" class="btn btn-default" id="btnCollapseTreeNode" title="${text('折叠全部')}"><i class="fa fa-angle-double-up"></i> ${text('折叠')}</a> <%
if(hasPermi('cms:category:edit')){ %>
<a href="${ctx}/cms/category/form?site.siteCode=${category.site.siteCode}" class="btn btn-default btnTool" title="${text('栏目添加')}"><i class="fa fa-plus"></i>${text('新增')}</a>
<a href="${ctx}/cms/category/form?site.siteCode=${category.site.siteCode}" class="btn btn-primary btnTool" title="${text('新增栏目')}"><i class="fa fa-plus"></i>${text('新增')}</a>
<% } %>
</div>
</div>
@@ -32,28 +32,35 @@
<#form:form id="searchForm" model="${category}" action="${ctx}/cms/category/listData" method="post" class="form-inline "
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
<#form:hidden path="site.siteCode" maxlength="64" class="form-control width-120" />
<#form:hidden path="categoryCode" />
<div class="form-group">
<label class="control-label">${text('栏目名称')}</label>
<label class="control-label">${text('编码')}</label>
<div class="control-inline">
<#form:input path="categoryName" maxlength="100" class="form-control width-120" />
<#form:input path="categoryCode_like" maxlength="100" class="form-control width-90" />
</div>
</div>
<div class="form-group">
<label class="control-label">${text('模块类型')}</label>
<label class="control-label">${text('名称')}</label>
<div class="control-inline">
<#form:input path="moduleType" maxlength="50" class="form-control width-120" />
<#form:input path="categoryName" maxlength="100" class="form-control width-90" />
</div>
</div>
<div class="form-group">
<label class="control-label">${text('模型')}</label>
<div class="control-inline width-90">
<#form:select path="moduleType" dictType="cms_module_type" blankOption="true" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label">${text('状态')}</label>
<div class="control-inline width-120">
<div class="control-inline width-90">
<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label">${text('备注信息')}</label>
<label class="control-label">${text('备注')}</label>
<div class="control-inline">
<#form:input path="remarks" maxlength="500" class="form-control width-120" />
<#form:input path="remarks" maxlength="500" class="form-control width-90" />
</div>
</div>
<div class="form-group">
@@ -74,31 +81,40 @@ $('#dataGrid').dataGrid({
{header:'${text("名称")}', name:'categoryName', index:'a.category_name', width:250, align:"left", frozen:true, formatter: function(val, obj, row, act){
return '( '+row.categoryCode+' ) '+'<a href="${ctx}/cms/category/form?categoryCode='+row.categoryCode+'" class="btnList" data-title="${text("编辑栏目表")}">'+(val||row.id)+'</a>';
}},
{header:'${text("模型")}', name:'moduleType', index:'a.module_type', width:100, align:"center"},
{header:'${text("排序")}', name:'treeSort', index:'a.tree_sort', width:50, align:"center"},
{header:'${text("模型")}', name:'moduleType', index:'a.module_type', width:100, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel("#{@DictUtils.getDictListJson('cms_module_type')}", val, '未知', true);
}},
{header:'${text("排序")}', name:'treeSort', index:'a.tree_sort', width:60, align:"center"},
{header:'${text("导航栏目")}', name:'inMenu', index:'a.in_menu', width:80, fixed:true, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel("#{@DictUtils.getDictListJson('sys_show_hide')}", val, '未知', true);
}},
{header:'${text("栏目列表")}', name:'inList', index:'a.in_list', width:80, fixed:true, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel("#{@DictUtils.getDictListJson('sys_show_hide')}", val, '未知', true);
}},
{header:'${text("展现方式")}', name:'showModes', index:'a.show_modes', width:150, fixed:true, align:"center", formatter: function(val, obj, row, act){
{header:'${text("展现方式")}', name:'showModes', index:'a.show_modes', width:90, fixed:true, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel("#{@DictUtils.getDictListJson('cms_show_modes')}", val, '未知', true);
}},
{header:'${text("操作")}', name:'actions', width:150, formatter: function(val, obj, row, act){
{header:'${text("状态")}', name:'status', index:'a.status', width:90, fixed:true, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel("#{@DictUtils.getDictListJson('sys_status')}", val, '未知', true);
}},
{header:'${text("备注")}', name:'remarks', index:'a.remarks', width:100, align:"left"},
{header:'${text("操作")}', name:'actions', width:210, formatter: function(val, obj, row, act){
var actions = [];
//# if(hasPermi('cms:category:edit')){
actions.push('<a href="${ctx}/cms/category/form?categoryCode='+row.categoryCode+'" class="btnList" title="${text("编辑栏目表")}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/category/form?categoryCode='+row.categoryCode+'" class="btnList" title="${text("编辑栏目表")}"><i class="fa icon-note"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/cms/category/disable?categoryCode='+row.categoryCode+'" class="btnList" title="${text("停用栏目表")}" data-confirm="${text("确认要停用该栏目表吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/category/disable?categoryCode='+row.categoryCode+'" class="btnList" title="${text("停用栏目表")}" data-confirm="${text("确认要停用该栏目表吗?")}"><i class="fa icon-ban"></i></a>&nbsp;');
}
if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/cms/category/enable?categoryCode='+row.categoryCode+'" class="btnList" title="${text("启用栏目表")}" data-confirm="${text("确认要启用该栏目表吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/category/enable?categoryCode='+row.categoryCode+'" class="btnList" title="${text("启用栏目表")}" data-confirm="${text("确认要启用该栏目表吗?")}"><i class="fa icon-check"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/cms/category/delete?categoryCode='+row.categoryCode+'" class="btnList" title="${text("删除栏目表")}" data-confirm="${text("确认要删除该栏目表及所有子栏目表吗?")}" data-deltreenode="'+row.id+'"><i class="fa fa-trash-o"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/category/form?parentCode='+row.id+'&site.siteCode=${category.site.siteCode}" class="btnList" title="${text("新增下级栏目表")}"><i class="fa fa-plus-square"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/category/form?parentCode='+row.id+'&site.siteCode=${category.site.siteCode}" class="btnList" title="${text("新增下级栏目表")}"><i class="fa icon-plus"></i></a>&nbsp;');
//# if(hasPermi('cms:category:rebuildIndex')){
actions.push('<a href="${ctx}/cms/category/rebuildIndex?categoryCode='+row.categoryCode+'" class="btnList" title="${text("重建该栏目索引")}" data-confirm="${text("确认重建该栏目文章索引吗")}"><i class="fa fa-crosshairs"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/category/rebuildIndex?categoryCode='+row.categoryCode+'" class="btnList" title="${text("重建该栏目索引")}" data-confirm="${text("确认重建该栏目文章索引吗")}"><i class="fa fa-crosshairs"></i></a>&nbsp;');
//# }
//# if(hasPermi('cms:category:rebuildVectorStore')){
actions.push('<a href="${ctx}/cms/category/rebuildVectorStore?categoryCode='+row.categoryCode+'" class="btnList" title="${text("重建该栏目向量数据库")}" data-confirm="${text("确认重建该栏目文章向量数据库吗")}"><i class="fa fa-database"></i></a>&nbsp;');
//# }
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctxFront}/list-'+row.categoryCode+'" target="_blank" title="${text("访问栏目")}"><i class="fa fa-globe"></i></a>&nbsp;');
@@ -109,10 +125,13 @@ $('#dataGrid').dataGrid({
],
treeGrid: true, // 启用树结构表格
defaultExpandLevel: 0, // 默认展开的层次
expandNodeClearPostData: 'categoryName,siteCode,moduleType,image,href,target,keywords,description,inMenu,inList,showModes,isNeedAudit,isCanComment,customListView,customContentView,viewConfig,status,remarks,', // 展开节点清理请求参数数据(一般设置查询条件的字段属性,否则在查询后,不能展开子节点数据)
expandNodeClearPostData: 'categoryCode,categoryName,siteCode,moduleType,image,href,target,keywords,description,inMenu,inList,showModes,isNeedAudit,isCanComment,customListView,customContentView,viewConfig,status,remarks,', // 展开节点清理请求参数数据(一般设置查询条件的字段属性,否则在查询后,不能展开子节点数据)
//# // 加载成功后执行事件
ajaxSuccess: function(data){
if ($('#categoryCode').val() != ''){
$('#categoryCode').val('');
$('#btnExpandTreeNode').click();
}
}
});
</script>

View File

@@ -58,13 +58,13 @@ var setting = {
&& ((src.indexOf("article") > 0 && adminUrl.indexOf("article") > 0)
|| (src.indexOf("link") > 0 && adminUrl.indexOf("link") > 0))){
var win = ifr[0].contentWindow, conts = ifr.contents();
conts.find('input[type=reset]').click();
//conts.find('input[type=reset]').click();
conts.find('#categoryCode').val(treeNode.id);
conts.find('#outline').val(adminUrl.indexOf("outline=true") != -1); // 文章模型是否显示大纲视图
conts.find('#fileDown').val(adminUrl.indexOf("fileDown=true") != -1); // 链接模型是否是下载栏目
var caption = conts.find('.portlet-title .caption');
caption.html(caption.find('i').prop("outerHTML") + " " + treeNode.name);
win.page();
win.page(1);
}else{
$('#mainFrame').attr("src", adminUrl);
}

View File

@@ -8,7 +8,7 @@
<div class="box-tools pull-right">
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
<% if(hasPermi('cms:comment:edit')){ %>
<a href="${ctx}/cms/comment/form" class="btn btn-default btnTool" title="${text('新增文章评论表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<a href="${ctx}/cms/comment/form" class="btn btn-primary btnTool" title="${text('新增文章评论表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<% } %>
</div>
</div>
@@ -130,12 +130,12 @@ $('#dataGrid').dataGrid({
{header:'${text('操作')}', name:'actions', width:120, formatter: function(val, obj, row, act){
var actions = [];
//# if(hasPermi('cms:comment:edit')){
actions.push('<a href="${ctx}/cms/comment/form?id='+row.id+'" class="btnList" title="${text('编辑文章评论表')}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/comment/form?id='+row.id+'" class="btnList" title="${text('编辑文章评论表')}"><i class="fa icon-note"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/cms/comment/disable?id='+row.id+'" class="btnList" title="${text('停用文章评论表')}" data-confirm="${text('确认要停用该文章评论表吗')}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/comment/disable?id='+row.id+'" class="btnList" title="${text('停用文章评论表')}" data-confirm="${text('确认要停用该文章评论表吗')}"><i class="fa icon-ban"></i></a>&nbsp;');
}
if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/cms/comment/enable?id='+row.id+'" class="btnList" title="${text('启用文章评论表')}" data-confirm="${text('确认要启用该文章评论表吗')}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/comment/enable?id='+row.id+'" class="btnList" title="${text('启用文章评论表')}" data-confirm="${text('确认要启用该文章评论表吗')}"><i class="fa icon-check"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/cms/comment/delete?id='+row.id+'" class="btnList" title="${text('删除文章评论表')}" data-confirm="${text('确认要删除该文章评论表吗')}"><i class="fa fa-trash-o"></i></a>&nbsp;');
//# }

View File

@@ -8,7 +8,7 @@
<div class="box-tools pull-right">
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
<% if(hasPermi('cms:report:edit')){ %>
<a href="${ctx}/cms/report/form" class="btn btn-default btnTool" title="${text('新增内容举报表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<a href="${ctx}/cms/report/form" class="btn btn-primary btnTool" title="${text('新增内容举报表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<% } %>
</div>
</div>
@@ -71,12 +71,12 @@ $('#dataGrid').dataGrid({
{header:'${text('操作')}', name:'actions', width:120, formatter: function(val, obj, row, act){
var actions = [];
//# if(hasPermi('cms:report:edit')){
actions.push('<a href="${ctx}/cms/report/form?id='+row.id+'" class="btnList" title="${text('编辑内容举报表')}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/report/form?id='+row.id+'" class="btnList" title="${text('编辑内容举报表')}"><i class="fa icon-note"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/cms/report/disable?id='+row.id+'" class="btnList" title="${text('停用内容举报表')}" data-confirm="${text('确认要停用该内容举报表吗')}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/report/disable?id='+row.id+'" class="btnList" title="${text('停用内容举报表')}" data-confirm="${text('确认要停用该内容举报表吗')}"><i class="fa icon-ban"></i></a>&nbsp;');
}
if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/cms/report/enable?id='+row.id+'" class="btnList" title="${text('启用内容举报表')}" data-confirm="${text('确认要启用该内容举报表吗')}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/report/enable?id='+row.id+'" class="btnList" title="${text('启用内容举报表')}" data-confirm="${text('确认要启用该内容举报表吗')}"><i class="fa icon-check"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/cms/report/delete?id='+row.id+'" class="btnList" title="${text('删除内容举报表')}" data-confirm="${text('确认要删除该内容举报表吗')}"><i class="fa fa-trash-o"></i></a>&nbsp;');
//# }

View File

@@ -8,7 +8,7 @@
<div class="box-tools pull-right">
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
<% if(hasPermi('cms:site:edit')){ %>
<a href="${ctx}/cms/site/form" class="btn btn-default btnTool" title="${text('新增站点')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<a href="${ctx}/cms/site/form" class="btn btn-primary btnTool" title="${text('新增站点')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<% } %>
</div>
</div>
@@ -67,20 +67,23 @@ $('#dataGrid').dataGrid({
return js.getDictLabel("#{@DictUtils.getDictListJson('sys_search_status')}", val, '${text("未知")}', true);
}},
{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
{header:'${text("操作")}', name:'actions', width:150, formatter: function(val, obj, row, act){
{header:'${text("操作")}', name:'actions', width:183, formatter: function(val, obj, row, act){
var actions = [];
//# if(hasPermi('cms:site:edit')){
actions.push('<a href="${ctx}/cms/site/form?siteCode='+row.siteCode+'" class="btnList" title="${text("编辑站点")}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/site/form?siteCode='+row.siteCode+'" class="btnList" title="${text("编辑站点")}"><i class="fa icon-note"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/cms/site/disable?siteCode='+row.siteCode+'" class="btnList" title="${text("停用站点")}" data-confirm="${text("确认要停用该站点吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/site/disable?siteCode='+row.siteCode+'" class="btnList" title="${text("停用站点")}" data-confirm="${text("确认要停用该站点吗?")}"><i class="fa icon-ban"></i></a>&nbsp;');
}
if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/cms/site/enable?siteCode='+row.siteCode+'" class="btnList" title="${text("启用站点")}" data-confirm="${text("确认要启用该站点吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/site/enable?siteCode='+row.siteCode+'" class="btnList" title="${text("启用站点")}" data-confirm="${text("确认要启用该站点吗?")}"><i class="fa icon-check"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/cms/site/delete?siteCode='+row.siteCode+'" class="btnList" title="${text("删除站点")}" data-confirm="${text("确认要删除该站点吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
//# if(hasPermi('cms:site:rebuildIndex')){
actions.push('<a href="${ctx}/cms/site/rebuildIndex?siteCode='+row.siteCode+'" class="btnList" title="${text("重建该站点索引")}" data-confirm="${text("确认重建该站点文章索引吗")}"><i class="fa fa-crosshairs"></i></a>&nbsp;');
//# }
//# if(hasPermi('cms:site:rebuildVectorStore')){
actions.push('<a href="${ctx}/cms/site/rebuildVectorStore?siteCode='+row.siteCode+'" class="btnList" title="${text("重建该站点向量数据库")}" data-confirm="${text("确认重建该站点文章向量数据库吗")}"><i class="fa fa-database"></i></a>&nbsp;');
//# }
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctxFront}/index-'+row.siteCode+'" target="_blank" title="${text("访问站点")}"><i class="fa fa-globe"></i></a>&nbsp;');
}

View File

@@ -8,7 +8,7 @@
<div class="box-tools pull-right">
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
<!-- <% if(hasPermi('cms:visitLog:edit')){ %>
<a href="${ctx}/cms/visitLog/form" class="btn btn-default btnTool" title="${text('新增访问日志表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<a href="${ctx}/cms/visitLog/form" class="btn btn-primary btnTool" title="${text('新增访问日志表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
<% } %> -->
</div>
</div>
@@ -92,12 +92,12 @@ $('#dataGrid').dataGrid({
{header:'${text('操作')}', name:'actions', width:120, formatter: function(val, obj, row, act){
var actions = [];
//# if(hasPermi('cms:visitLog:edit')){
actions.push('<a href="${ctx}/cms/visitLog/form?id='+row.id+'" class="btnList" title="${text('编辑访问日志表')}"><i class="fa fa-pencil"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/visitLog/form?id='+row.id+'" class="btnList" title="${text('编辑访问日志表')}"><i class="fa icon-note"></i></a>&nbsp;');
if (row.status == Global.STATUS_NORMAL){
actions.push('<a href="${ctx}/cms/visitLog/disable?id='+row.id+'" class="btnList" title="${text('停用访问日志表')}" data-confirm="${text('确认要停用该访问日志表吗')}"><i class="glyphicon glyphicon-ban-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/visitLog/disable?id='+row.id+'" class="btnList" title="${text('停用访问日志表')}" data-confirm="${text('确认要停用该访问日志表吗')}"><i class="fa icon-ban"></i></a>&nbsp;');
}
if (row.status == Global.STATUS_DISABLE){
actions.push('<a href="${ctx}/cms/visitLog/enable?id='+row.id+'" class="btnList" title="${text('启用访问日志表')}" data-confirm="${text('确认要启用该访问日志表吗')}"><i class="glyphicon glyphicon-ok-circle"></i></a>&nbsp;');
actions.push('<a href="${ctx}/cms/visitLog/enable?id='+row.id+'" class="btnList" title="${text('启用访问日志表')}" data-confirm="${text('确认要启用该访问日志表吗')}"><i class="fa icon-check"></i></a>&nbsp;');
}
actions.push('<a href="${ctx}/cms/visitLog/delete?id='+row.id+'" class="btnList" title="${text('删除访问日志表')}" data-confirm="${text('确认要删除该访问日志表吗')}"><i class="fa fa-trash-o"></i></a>&nbsp;');
//# }

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,31 @@
/* Create Tables */
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar(64) NOT NULL,
view_code varchar(500),
category_name varchar(64) NOT NULL,
parent_code varchar(64) NOT NULL,
parent_codes varchar(767) NOT NULL,
tree_sort decimal(10) NOT NULL,
tree_sorts varchar(767) NOT NULL,
tree_leaf char(1) NOT NULL,
tree_level decimal(4) NOT NULL,
tree_names varchar(767) NOT NULL,
status char(1) DEFAULT '0' NOT NULL,
create_by varchar(64) NOT NULL,
create_date timestamp NOT NULL,
update_by varchar(64) NOT NULL,
update_date timestamp NOT NULL,
remarks vargraphic(500),
corp_code varchar(64) DEFAULT '0' NOT NULL,
corp_name vargraphic(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY (category_code)
);
-- 代码生成表
CREATE TABLE js_gen_table
(
@@ -79,31 +104,6 @@ CREATE TABLE js_sys_area
);
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar(64) NOT NULL,
view_code varchar(500),
category_name varchar(64) NOT NULL,
parent_code varchar(64) NOT NULL,
parent_codes varchar(767) NOT NULL,
tree_sort decimal(10) NOT NULL,
tree_sorts varchar(767) NOT NULL,
tree_leaf char(1) NOT NULL,
tree_level decimal(4) NOT NULL,
tree_names varchar(767) NOT NULL,
status char(1) DEFAULT '0' NOT NULL,
create_by varchar(64) NOT NULL,
create_date timestamp NOT NULL,
update_by varchar(64) NOT NULL,
update_date timestamp NOT NULL,
remarks vargraphic(500),
corp_code varchar(64) DEFAULT '0' NOT NULL,
corp_name vargraphic(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY (category_code)
);
-- 公司表
CREATE TABLE js_sys_company
(
@@ -492,6 +492,21 @@ CREATE TABLE js_sys_menu
);
-- 菜单数据权限
CREATE TABLE js_sys_menu_data_scope
(
id varchar(64) NOT NULL,
role_code varchar(64) NOT NULL,
menu_code varchar(64) NOT NULL,
rule_name varchar(100),
rule_type char(1),
rule_config clob,
status char(1),
remarks vargraphic(500),
PRIMARY KEY (id)
);
-- 模块表
CREATE TABLE js_sys_module
(
@@ -767,7 +782,8 @@ CREATE TABLE js_sys_role_data_scope
ctrl_type varchar(20) NOT NULL,
ctrl_data varchar(64) NOT NULL,
ctrl_permi varchar(64) NOT NULL,
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi)
menu_code varchar(64) DEFAULT '0' NOT NULL,
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi, menu_code)
);
@@ -934,6 +950,8 @@ CREATE INDEX idx_sys_menu_sc ON js_sys_menu (sys_code);
CREATE INDEX idx_sys_menu_is ON js_sys_menu (is_show);
CREATE INDEX idx_sys_menu_mcs ON js_sys_menu (module_codes);
CREATE INDEX idx_sys_menu_wt ON js_sys_menu (weight);
CREATE INDEX idx_sys_menu_ds_mc ON js_sys_menu_data_scope (menu_code);
CREATE INDEX idx_sys_menu_ds_rc ON js_sys_menu_data_scope (role_code);
CREATE INDEX idx_sys_module_status ON js_sys_module (status);
CREATE INDEX idx_sys_msg_inner_cb ON js_sys_msg_inner (create_by);
CREATE INDEX idx_sys_msg_inner_status ON js_sys_msg_inner (status);

View File

@@ -2,6 +2,31 @@
/* Create Tables */
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar(64) NOT NULL,
view_code varchar(500),
category_name varchar(64) NOT NULL,
parent_code varchar(64) NOT NULL,
parent_codes varchar(767) NOT NULL,
tree_sort decimal(10) NOT NULL,
tree_sorts varchar(767) NOT NULL,
tree_leaf char(1) NOT NULL,
tree_level decimal(4) NOT NULL,
tree_names varchar(767) NOT NULL,
status char(1) DEFAULT '0' NOT NULL,
create_by varchar(64) NOT NULL,
create_date datetime NOT NULL,
update_by varchar(64) NOT NULL,
update_date datetime NOT NULL,
remarks varchar(500),
corp_code varchar(64) DEFAULT '0' NOT NULL,
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY (category_code)
);
-- 代码生成表
CREATE TABLE js_gen_table
(
@@ -79,31 +104,6 @@ CREATE TABLE js_sys_area
);
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar(64) NOT NULL,
view_code varchar(500),
category_name varchar(64) NOT NULL,
parent_code varchar(64) NOT NULL,
parent_codes varchar(767) NOT NULL,
tree_sort decimal(10) NOT NULL,
tree_sorts varchar(767) NOT NULL,
tree_leaf char(1) NOT NULL,
tree_level decimal(4) NOT NULL,
tree_names varchar(767) NOT NULL,
status char(1) DEFAULT '0' NOT NULL,
create_by varchar(64) NOT NULL,
create_date datetime NOT NULL,
update_by varchar(64) NOT NULL,
update_date datetime NOT NULL,
remarks varchar(500),
corp_code varchar(64) DEFAULT '0' NOT NULL,
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY (category_code)
);
-- 公司表
CREATE TABLE js_sys_company
(
@@ -492,6 +492,21 @@ CREATE TABLE js_sys_menu
);
-- 菜单数据权限
CREATE TABLE js_sys_menu_data_scope
(
id varchar(64) NOT NULL,
role_code varchar(64) NOT NULL,
menu_code varchar(64) NOT NULL,
rule_name varchar(100),
rule_type char(1),
rule_config clob,
status char(1),
remarks varchar(500),
PRIMARY KEY (id)
);
-- 模块表
CREATE TABLE js_sys_module
(
@@ -767,7 +782,8 @@ CREATE TABLE js_sys_role_data_scope
ctrl_type varchar(20) NOT NULL,
ctrl_data varchar(64) NOT NULL,
ctrl_permi varchar(64) NOT NULL,
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi)
menu_code varchar(64) DEFAULT '0' NOT NULL,
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi, menu_code)
);
@@ -934,6 +950,8 @@ CREATE INDEX idx_sys_menu_sc ON js_sys_menu (sys_code);
CREATE INDEX idx_sys_menu_is ON js_sys_menu (is_show);
CREATE INDEX idx_sys_menu_mcs ON js_sys_menu (module_codes);
CREATE INDEX idx_sys_menu_wt ON js_sys_menu (weight);
CREATE INDEX idx_sys_menu_ds_mc ON js_sys_menu_data_scope (menu_code);
CREATE INDEX idx_sys_menu_ds_rc ON js_sys_menu_data_scope (role_code);
CREATE INDEX idx_sys_module_status ON js_sys_module (status);
CREATE INDEX idx_sys_msg_inner_cb ON js_sys_msg_inner (create_by);
CREATE INDEX idx_sys_msg_inner_status ON js_sys_msg_inner (status);
@@ -999,6 +1017,25 @@ CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code);
/* Comments */
COMMENT ON TABLE js_biz_category IS '业务分类';
COMMENT ON COLUMN js_biz_category.category_code IS '流程分类';
COMMENT ON COLUMN js_biz_category.view_code IS '分类代码';
COMMENT ON COLUMN js_biz_category.category_name IS '分类名称';
COMMENT ON COLUMN js_biz_category.parent_code IS '父级编号';
COMMENT ON COLUMN js_biz_category.parent_codes IS '所有父级编号';
COMMENT ON COLUMN js_biz_category.tree_sort IS '排序号(升序)';
COMMENT ON COLUMN js_biz_category.tree_sorts IS '所有排序号';
COMMENT ON COLUMN js_biz_category.tree_leaf IS '是否最末级';
COMMENT ON COLUMN js_biz_category.tree_level IS '层次级别';
COMMENT ON COLUMN js_biz_category.tree_names IS '全节点名';
COMMENT ON COLUMN js_biz_category.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_biz_category.create_by IS '创建者';
COMMENT ON COLUMN js_biz_category.create_date IS '创建时间';
COMMENT ON COLUMN js_biz_category.update_by IS '更新者';
COMMENT ON COLUMN js_biz_category.update_date IS '更新时间';
COMMENT ON COLUMN js_biz_category.remarks IS '备注信息';
COMMENT ON COLUMN js_biz_category.corp_code IS '租户代码';
COMMENT ON COLUMN js_biz_category.corp_name IS '租户名称';
COMMENT ON TABLE js_gen_table IS '代码生成表';
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
@@ -1058,25 +1095,6 @@ COMMENT ON COLUMN js_sys_area.create_date IS '创建时间';
COMMENT ON COLUMN js_sys_area.update_by IS '更新者';
COMMENT ON COLUMN js_sys_area.update_date IS '更新时间';
COMMENT ON COLUMN js_sys_area.remarks IS '备注信息';
COMMENT ON TABLE js_biz_category IS '业务分类';
COMMENT ON COLUMN js_biz_category.category_code IS '流程分类';
COMMENT ON COLUMN js_biz_category.view_code IS '分类代码';
COMMENT ON COLUMN js_biz_category.category_name IS '分类名称';
COMMENT ON COLUMN js_biz_category.parent_code IS '父级编号';
COMMENT ON COLUMN js_biz_category.parent_codes IS '所有父级编号';
COMMENT ON COLUMN js_biz_category.tree_sort IS '排序号(升序)';
COMMENT ON COLUMN js_biz_category.tree_sorts IS '所有排序号';
COMMENT ON COLUMN js_biz_category.tree_leaf IS '是否最末级';
COMMENT ON COLUMN js_biz_category.tree_level IS '层次级别';
COMMENT ON COLUMN js_biz_category.tree_names IS '全节点名';
COMMENT ON COLUMN js_biz_category.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_biz_category.create_by IS '创建者';
COMMENT ON COLUMN js_biz_category.create_date IS '创建时间';
COMMENT ON COLUMN js_biz_category.update_by IS '更新者';
COMMENT ON COLUMN js_biz_category.update_date IS '更新时间';
COMMENT ON COLUMN js_biz_category.remarks IS '备注信息';
COMMENT ON COLUMN js_biz_category.corp_code IS '租户代码';
COMMENT ON COLUMN js_biz_category.corp_name IS '租户名称';
COMMENT ON TABLE js_sys_company IS '公司表';
COMMENT ON COLUMN js_sys_company.company_code IS '公司编码';
COMMENT ON COLUMN js_sys_company.view_code IS '公司代码';
@@ -1375,6 +1393,15 @@ COMMENT ON COLUMN js_sys_menu.extend_d2 IS '扩展 Date 2';
COMMENT ON COLUMN js_sys_menu.extend_d3 IS '扩展 Date 3';
COMMENT ON COLUMN js_sys_menu.extend_d4 IS '扩展 Date 4';
COMMENT ON COLUMN js_sys_menu.extend_json IS '扩展 JSON';
COMMENT ON TABLE js_sys_menu_data_scope IS '菜单数据权限';
COMMENT ON COLUMN js_sys_menu_data_scope.id IS '编号';
COMMENT ON COLUMN js_sys_menu_data_scope.role_code IS '角色编码';
COMMENT ON COLUMN js_sys_menu_data_scope.menu_code IS '菜单编码';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_name IS '规则名称';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_type IS '规则类型1 角色数据范围 2自定义条件规则 3自定义SQL';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_config IS '规则配置JSON';
COMMENT ON COLUMN js_sys_menu_data_scope.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_sys_menu_data_scope.remarks IS '备注信息';
COMMENT ON TABLE js_sys_module IS '模块表';
COMMENT ON COLUMN js_sys_module.module_code IS '模块编码';
COMMENT ON COLUMN js_sys_module.module_name IS '模块名称';
@@ -1551,7 +1578,7 @@ COMMENT ON COLUMN js_sys_role.is_sys IS '系统内置1是 0否';
COMMENT ON COLUMN js_sys_role.is_show IS '是否显示';
COMMENT ON COLUMN js_sys_role.user_type IS '用户类型employee员工 member会员';
COMMENT ON COLUMN js_sys_role.desktop_url IS '桌面地址(仪表盘地址)';
COMMENT ON COLUMN js_sys_role.data_scope IS '数据范围设置0未设置 1全部数据 2自定义数据';
COMMENT ON COLUMN js_sys_role.data_scope IS '数据范围0未设置 1全部数据 2自定义数据';
COMMENT ON COLUMN js_sys_role.biz_scope IS '适应业务范围(不同的功能,不同的数据权限支持)';
COMMENT ON COLUMN js_sys_role.sys_codes IS '包含系统(多个用逗号隔开)';
COMMENT ON COLUMN js_sys_role.status IS '状态0正常 1删除 2停用';
@@ -1588,6 +1615,7 @@ COMMENT ON COLUMN js_sys_role_data_scope.role_code IS '控制角色编码';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_type IS '控制类型';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_data IS '控制数据';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_permi IS '控制权限';
COMMENT ON COLUMN js_sys_role_data_scope.menu_code IS '菜单编码';
COMMENT ON TABLE js_sys_role_menu IS '角色与菜单关联表';
COMMENT ON COLUMN js_sys_role_menu.role_code IS '角色编码';
COMMENT ON COLUMN js_sys_role_menu.menu_code IS '菜单编码';

View File

@@ -2,6 +2,31 @@
/* Create Tables */
-- 业务分类
CREATE TABLE [js_biz_category]
(
[category_code] varchar(64) NOT NULL,
[view_code] varchar(500),
[category_name] varchar(64) NOT NULL,
[parent_code] varchar(64) NOT NULL,
[parent_codes] varchar(767) NOT NULL,
[tree_sort] decimal(10) NOT NULL,
[tree_sorts] varchar(767) NOT NULL,
[tree_leaf] char(1) NOT NULL,
[tree_level] decimal(4) NOT NULL,
[tree_names] varchar(767) NOT NULL,
[status] char(1) DEFAULT '0' NOT NULL,
[create_by] varchar(64) NOT NULL,
[create_date] datetime NOT NULL,
[update_by] varchar(64) NOT NULL,
[update_date] datetime NOT NULL,
[remarks] nvarchar(500),
[corp_code] varchar(64) DEFAULT '0' NOT NULL,
[corp_name] nvarchar(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY ([category_code])
);
-- 代码生成表
CREATE TABLE [js_gen_table]
(
@@ -79,31 +104,6 @@ CREATE TABLE [js_sys_area]
);
-- 业务分类
CREATE TABLE [js_biz_category]
(
[category_code] varchar(64) NOT NULL,
[view_code] varchar(500),
[category_name] varchar(64) NOT NULL,
[parent_code] varchar(64) NOT NULL,
[parent_codes] varchar(767) NOT NULL,
[tree_sort] decimal(10) NOT NULL,
[tree_sorts] varchar(767) NOT NULL,
[tree_leaf] char(1) NOT NULL,
[tree_level] decimal(4) NOT NULL,
[tree_names] varchar(767) NOT NULL,
[status] char(1) DEFAULT '0' NOT NULL,
[create_by] varchar(64) NOT NULL,
[create_date] datetime NOT NULL,
[update_by] varchar(64) NOT NULL,
[update_date] datetime NOT NULL,
[remarks] nvarchar(500),
[corp_code] varchar(64) DEFAULT '0' NOT NULL,
[corp_name] nvarchar(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY ([category_code])
);
-- 公司表
CREATE TABLE [js_sys_company]
(
@@ -492,6 +492,21 @@ CREATE TABLE [js_sys_menu]
);
-- 菜单数据权限
CREATE TABLE [js_sys_menu_data_scope]
(
[id] varchar(64) NOT NULL,
[role_code] varchar(64) NOT NULL,
[menu_code] varchar(64) NOT NULL,
[rule_name] varchar(100),
[rule_type] char(1),
[rule_config] text,
[status] char(1),
[remarks] nvarchar(500),
PRIMARY KEY ([id])
);
-- 模块表
CREATE TABLE [js_sys_module]
(
@@ -767,7 +782,8 @@ CREATE TABLE [js_sys_role_data_scope]
[ctrl_type] varchar(20) NOT NULL,
[ctrl_data] varchar(64) NOT NULL,
[ctrl_permi] varchar(64) NOT NULL,
PRIMARY KEY ([role_code], [ctrl_type], [ctrl_data], [ctrl_permi])
[menu_code] varchar(64) DEFAULT '0' NOT NULL,
PRIMARY KEY ([role_code], [ctrl_type], [ctrl_data], [ctrl_permi], [menu_code])
);
@@ -934,6 +950,8 @@ CREATE INDEX [idx_sys_menu_sc] ON [js_sys_menu] ([sys_code]);
CREATE INDEX [idx_sys_menu_is] ON [js_sys_menu] ([is_show]);
CREATE INDEX [idx_sys_menu_mcs] ON [js_sys_menu] ([module_codes]);
CREATE INDEX [idx_sys_menu_wt] ON [js_sys_menu] ([weight]);
CREATE INDEX [idx_sys_menu_ds_mc] ON [js_sys_menu_data_scope] ([menu_code]);
CREATE INDEX [idx_sys_menu_ds_rc] ON [js_sys_menu_data_scope] ([role_code]);
CREATE INDEX [idx_sys_module_status] ON [js_sys_module] ([status]);
CREATE INDEX [idx_sys_msg_inner_cb] ON [js_sys_msg_inner] ([create_by]);
CREATE INDEX [idx_sys_msg_inner_status] ON [js_sys_msg_inner] ([status]);

View File

@@ -3,6 +3,31 @@ SET SESSION FOREIGN_KEY_CHECKS=0;
/* Create Tables */
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar(64) NOT NULL COMMENT '流程分类',
view_code varchar(500) COMMENT '分类代码',
category_name varchar(64) NOT NULL COMMENT '分类名称',
parent_code varchar(64) NOT NULL COMMENT '父级编号',
parent_codes varchar(767) NOT NULL COMMENT '所有父级编号',
tree_sort decimal(10) NOT NULL COMMENT '排序号(升序)',
tree_sorts varchar(767) NOT NULL COMMENT '所有排序号',
tree_leaf char(1) NOT NULL COMMENT '是否最末级',
tree_level decimal(4) NOT NULL COMMENT '层次级别',
tree_names varchar(767) NOT NULL COMMENT '全节点名',
status char(1) DEFAULT '0' NOT NULL COMMENT '状态0正常 1删除 2停用',
create_by varchar(64) NOT NULL COMMENT '创建者',
create_date datetime NOT NULL COMMENT '创建时间',
update_by varchar(64) NOT NULL COMMENT '更新者',
update_date datetime NOT NULL COMMENT '更新时间',
remarks varchar(500) COMMENT '备注信息',
corp_code varchar(64) DEFAULT '0' NOT NULL COMMENT '租户代码',
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL COMMENT '租户名称',
PRIMARY KEY (category_code)
) COMMENT = '业务分类';
-- 代码生成表
CREATE TABLE js_gen_table
(
@@ -80,31 +105,6 @@ CREATE TABLE js_sys_area
) COMMENT = '行政区划';
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar(64) NOT NULL COMMENT '流程分类',
view_code varchar(500) COMMENT '分类代码',
category_name varchar(64) NOT NULL COMMENT '分类名称',
parent_code varchar(64) NOT NULL COMMENT '父级编号',
parent_codes varchar(767) NOT NULL COMMENT '所有父级编号',
tree_sort decimal(10) NOT NULL COMMENT '排序号(升序)',
tree_sorts varchar(767) NOT NULL COMMENT '所有排序号',
tree_leaf char(1) NOT NULL COMMENT '是否最末级',
tree_level decimal(4) NOT NULL COMMENT '层次级别',
tree_names varchar(767) NOT NULL COMMENT '全节点名',
status char(1) DEFAULT '0' NOT NULL COMMENT '状态0正常 1删除 2停用',
create_by varchar(64) NOT NULL COMMENT '创建者',
create_date datetime NOT NULL COMMENT '创建时间',
update_by varchar(64) NOT NULL COMMENT '更新者',
update_date datetime NOT NULL COMMENT '更新时间',
remarks varchar(500) COMMENT '备注信息',
corp_code varchar(64) DEFAULT '0' NOT NULL COMMENT '租户代码',
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL COMMENT '租户名称',
PRIMARY KEY (category_code)
) COMMENT = '业务分类';
-- 公司表
CREATE TABLE js_sys_company
(
@@ -493,6 +493,21 @@ CREATE TABLE js_sys_menu
) COMMENT = '菜单表';
-- 菜单数据权限
CREATE TABLE js_sys_menu_data_scope
(
id varchar(64) NOT NULL COMMENT '编号',
role_code varchar(64) NOT NULL COMMENT '角色编码',
menu_code varchar(64) NOT NULL COMMENT '菜单编码',
rule_name varchar(100) COMMENT '规则名称',
rule_type char(1) COMMENT '规则类型1 角色数据范围 2自定义条件规则 3自定义SQL',
rule_config text COMMENT '规则配置JSON',
status char(1) COMMENT '状态0正常 1删除 2停用',
remarks varchar(500) COMMENT '备注信息',
PRIMARY KEY (id)
) COMMENT = '菜单数据权限';
-- 模块表
CREATE TABLE js_sys_module
(
@@ -725,7 +740,7 @@ CREATE TABLE js_sys_role
is_show char(1) DEFAULT '1' COMMENT '是否显示',
user_type varchar(16) COMMENT '用户类型employee员工 member会员',
desktop_url varchar(255) COMMENT '桌面地址(仪表盘地址)',
data_scope char(1) COMMENT '数据范围设置0未设置 1全部数据 2自定义数据',
data_scope char(1) COMMENT '数据范围0未设置 1全部数据 2自定义数据',
biz_scope varchar(255) COMMENT '适应业务范围(不同的功能,不同的数据权限支持)',
sys_codes varchar(500) COMMENT '包含系统(多个用逗号隔开)',
status char(1) DEFAULT '0' NOT NULL COMMENT '状态0正常 1删除 2停用',
@@ -768,7 +783,8 @@ CREATE TABLE js_sys_role_data_scope
ctrl_type varchar(20) NOT NULL COMMENT '控制类型',
ctrl_data varchar(64) NOT NULL COMMENT '控制数据',
ctrl_permi varchar(64) NOT NULL COMMENT '控制权限',
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi)
menu_code varchar(64) DEFAULT '0' NOT NULL COMMENT '菜单编码',
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi, menu_code)
) COMMENT = '角色数据权限表';
@@ -935,6 +951,8 @@ CREATE INDEX idx_sys_menu_sc ON js_sys_menu (sys_code ASC);
CREATE INDEX idx_sys_menu_is ON js_sys_menu (is_show ASC);
CREATE INDEX idx_sys_menu_mcs ON js_sys_menu (module_codes ASC);
CREATE INDEX idx_sys_menu_wt ON js_sys_menu (weight ASC);
CREATE INDEX idx_sys_menu_ds_mc ON js_sys_menu_data_scope (menu_code ASC);
CREATE INDEX idx_sys_menu_ds_rc ON js_sys_menu_data_scope (role_code ASC);
CREATE INDEX idx_sys_module_status ON js_sys_module (status ASC);
CREATE INDEX idx_sys_msg_inner_cb ON js_sys_msg_inner (create_by ASC);
CREATE INDEX idx_sys_msg_inner_status ON js_sys_msg_inner (status ASC);

View File

@@ -2,6 +2,31 @@
/* Create Tables */
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar2(64) NOT NULL,
view_code varchar2(500),
category_name varchar2(64) NOT NULL,
parent_code varchar2(64) NOT NULL,
parent_codes varchar2(767) NOT NULL,
tree_sort number(10) NOT NULL,
tree_sorts varchar2(767) NOT NULL,
tree_leaf char(1) NOT NULL,
tree_level number(4) NOT NULL,
tree_names varchar2(767) NOT NULL,
status char(1) DEFAULT '0' NOT NULL,
create_by varchar2(64) NOT NULL,
create_date timestamp NOT NULL,
update_by varchar2(64) NOT NULL,
update_date timestamp NOT NULL,
remarks nvarchar2(500),
corp_code varchar2(64) DEFAULT '0' NOT NULL,
corp_name nvarchar2(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY (category_code)
);
-- 代码生成表
CREATE TABLE js_gen_table
(
@@ -79,31 +104,6 @@ CREATE TABLE js_sys_area
);
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar2(64) NOT NULL,
view_code varchar2(500),
category_name varchar2(64) NOT NULL,
parent_code varchar2(64) NOT NULL,
parent_codes varchar2(767) NOT NULL,
tree_sort number(10) NOT NULL,
tree_sorts varchar2(767) NOT NULL,
tree_leaf char(1) NOT NULL,
tree_level number(4) NOT NULL,
tree_names varchar2(767) NOT NULL,
status char(1) DEFAULT '0' NOT NULL,
create_by varchar2(64) NOT NULL,
create_date timestamp NOT NULL,
update_by varchar2(64) NOT NULL,
update_date timestamp NOT NULL,
remarks nvarchar2(500),
corp_code varchar2(64) DEFAULT '0' NOT NULL,
corp_name nvarchar2(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY (category_code)
);
-- 公司表
CREATE TABLE js_sys_company
(
@@ -492,6 +492,21 @@ CREATE TABLE js_sys_menu
);
-- 菜单数据权限
CREATE TABLE js_sys_menu_data_scope
(
id varchar2(64) NOT NULL,
role_code varchar2(64) NOT NULL,
menu_code varchar2(64) NOT NULL,
rule_name varchar2(100),
rule_type char(1),
rule_config clob,
status char(1),
remarks nvarchar2(500),
PRIMARY KEY (id)
);
-- 模块表
CREATE TABLE js_sys_module
(
@@ -767,7 +782,8 @@ CREATE TABLE js_sys_role_data_scope
ctrl_type varchar2(20) NOT NULL,
ctrl_data varchar2(64) NOT NULL,
ctrl_permi varchar2(64) NOT NULL,
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi)
menu_code varchar2(64) DEFAULT '0' NOT NULL,
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi, menu_code)
);
@@ -934,6 +950,8 @@ CREATE INDEX idx_sys_menu_sc ON js_sys_menu (sys_code);
CREATE INDEX idx_sys_menu_is ON js_sys_menu (is_show);
CREATE INDEX idx_sys_menu_mcs ON js_sys_menu (module_codes);
CREATE INDEX idx_sys_menu_wt ON js_sys_menu (weight);
CREATE INDEX idx_sys_menu_ds_mc ON js_sys_menu_data_scope (menu_code);
CREATE INDEX idx_sys_menu_ds_rc ON js_sys_menu_data_scope (role_code);
CREATE INDEX idx_sys_module_status ON js_sys_module (status);
CREATE INDEX idx_sys_msg_inner_cb ON js_sys_msg_inner (create_by);
CREATE INDEX idx_sys_msg_inner_status ON js_sys_msg_inner (status);
@@ -999,6 +1017,25 @@ CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code);
/* Comments */
COMMENT ON TABLE js_biz_category IS '业务分类';
COMMENT ON COLUMN js_biz_category.category_code IS '流程分类';
COMMENT ON COLUMN js_biz_category.view_code IS '分类代码';
COMMENT ON COLUMN js_biz_category.category_name IS '分类名称';
COMMENT ON COLUMN js_biz_category.parent_code IS '父级编号';
COMMENT ON COLUMN js_biz_category.parent_codes IS '所有父级编号';
COMMENT ON COLUMN js_biz_category.tree_sort IS '排序号(升序)';
COMMENT ON COLUMN js_biz_category.tree_sorts IS '所有排序号';
COMMENT ON COLUMN js_biz_category.tree_leaf IS '是否最末级';
COMMENT ON COLUMN js_biz_category.tree_level IS '层次级别';
COMMENT ON COLUMN js_biz_category.tree_names IS '全节点名';
COMMENT ON COLUMN js_biz_category.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_biz_category.create_by IS '创建者';
COMMENT ON COLUMN js_biz_category.create_date IS '创建时间';
COMMENT ON COLUMN js_biz_category.update_by IS '更新者';
COMMENT ON COLUMN js_biz_category.update_date IS '更新时间';
COMMENT ON COLUMN js_biz_category.remarks IS '备注信息';
COMMENT ON COLUMN js_biz_category.corp_code IS '租户代码';
COMMENT ON COLUMN js_biz_category.corp_name IS '租户名称';
COMMENT ON TABLE js_gen_table IS '代码生成表';
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
@@ -1058,25 +1095,6 @@ COMMENT ON COLUMN js_sys_area.create_date IS '创建时间';
COMMENT ON COLUMN js_sys_area.update_by IS '更新者';
COMMENT ON COLUMN js_sys_area.update_date IS '更新时间';
COMMENT ON COLUMN js_sys_area.remarks IS '备注信息';
COMMENT ON TABLE js_biz_category IS '业务分类';
COMMENT ON COLUMN js_biz_category.category_code IS '流程分类';
COMMENT ON COLUMN js_biz_category.view_code IS '分类代码';
COMMENT ON COLUMN js_biz_category.category_name IS '分类名称';
COMMENT ON COLUMN js_biz_category.parent_code IS '父级编号';
COMMENT ON COLUMN js_biz_category.parent_codes IS '所有父级编号';
COMMENT ON COLUMN js_biz_category.tree_sort IS '排序号(升序)';
COMMENT ON COLUMN js_biz_category.tree_sorts IS '所有排序号';
COMMENT ON COLUMN js_biz_category.tree_leaf IS '是否最末级';
COMMENT ON COLUMN js_biz_category.tree_level IS '层次级别';
COMMENT ON COLUMN js_biz_category.tree_names IS '全节点名';
COMMENT ON COLUMN js_biz_category.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_biz_category.create_by IS '创建者';
COMMENT ON COLUMN js_biz_category.create_date IS '创建时间';
COMMENT ON COLUMN js_biz_category.update_by IS '更新者';
COMMENT ON COLUMN js_biz_category.update_date IS '更新时间';
COMMENT ON COLUMN js_biz_category.remarks IS '备注信息';
COMMENT ON COLUMN js_biz_category.corp_code IS '租户代码';
COMMENT ON COLUMN js_biz_category.corp_name IS '租户名称';
COMMENT ON TABLE js_sys_company IS '公司表';
COMMENT ON COLUMN js_sys_company.company_code IS '公司编码';
COMMENT ON COLUMN js_sys_company.view_code IS '公司代码';
@@ -1375,6 +1393,15 @@ COMMENT ON COLUMN js_sys_menu.extend_d2 IS '扩展 Date 2';
COMMENT ON COLUMN js_sys_menu.extend_d3 IS '扩展 Date 3';
COMMENT ON COLUMN js_sys_menu.extend_d4 IS '扩展 Date 4';
COMMENT ON COLUMN js_sys_menu.extend_json IS '扩展 JSON';
COMMENT ON TABLE js_sys_menu_data_scope IS '菜单数据权限';
COMMENT ON COLUMN js_sys_menu_data_scope.id IS '编号';
COMMENT ON COLUMN js_sys_menu_data_scope.role_code IS '角色编码';
COMMENT ON COLUMN js_sys_menu_data_scope.menu_code IS '菜单编码';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_name IS '规则名称';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_type IS '规则类型1 角色数据范围 2自定义条件规则 3自定义SQL';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_config IS '规则配置JSON';
COMMENT ON COLUMN js_sys_menu_data_scope.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_sys_menu_data_scope.remarks IS '备注信息';
COMMENT ON TABLE js_sys_module IS '模块表';
COMMENT ON COLUMN js_sys_module.module_code IS '模块编码';
COMMENT ON COLUMN js_sys_module.module_name IS '模块名称';
@@ -1551,7 +1578,7 @@ COMMENT ON COLUMN js_sys_role.is_sys IS '系统内置1是 0否';
COMMENT ON COLUMN js_sys_role.is_show IS '是否显示';
COMMENT ON COLUMN js_sys_role.user_type IS '用户类型employee员工 member会员';
COMMENT ON COLUMN js_sys_role.desktop_url IS '桌面地址(仪表盘地址)';
COMMENT ON COLUMN js_sys_role.data_scope IS '数据范围设置0未设置 1全部数据 2自定义数据';
COMMENT ON COLUMN js_sys_role.data_scope IS '数据范围0未设置 1全部数据 2自定义数据';
COMMENT ON COLUMN js_sys_role.biz_scope IS '适应业务范围(不同的功能,不同的数据权限支持)';
COMMENT ON COLUMN js_sys_role.sys_codes IS '包含系统(多个用逗号隔开)';
COMMENT ON COLUMN js_sys_role.status IS '状态0正常 1删除 2停用';
@@ -1588,6 +1615,7 @@ COMMENT ON COLUMN js_sys_role_data_scope.role_code IS '控制角色编码';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_type IS '控制类型';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_data IS '控制数据';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_permi IS '控制权限';
COMMENT ON COLUMN js_sys_role_data_scope.menu_code IS '菜单编码';
COMMENT ON TABLE js_sys_role_menu IS '角色与菜单关联表';
COMMENT ON COLUMN js_sys_role_menu.role_code IS '角色编码';
COMMENT ON COLUMN js_sys_role_menu.menu_code IS '菜单编码';

View File

@@ -2,6 +2,31 @@
/* Create Tables */
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar(64) NOT NULL,
view_code varchar(500),
category_name varchar(64) NOT NULL,
parent_code varchar(64) NOT NULL,
parent_codes varchar(767) NOT NULL,
tree_sort decimal(10) NOT NULL,
tree_sorts varchar(767) NOT NULL,
tree_leaf char(1) NOT NULL,
tree_level decimal(4) NOT NULL,
tree_names varchar(767) NOT NULL,
status char(1) DEFAULT '0' NOT NULL,
create_by varchar(64) NOT NULL,
create_date timestamp NOT NULL,
update_by varchar(64) NOT NULL,
update_date timestamp NOT NULL,
remarks varchar(500),
corp_code varchar(64) DEFAULT '0' NOT NULL,
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY (category_code)
) WITHOUT OIDS;
-- 代码生成表
CREATE TABLE js_gen_table
(
@@ -79,31 +104,6 @@ CREATE TABLE js_sys_area
) WITHOUT OIDS;
-- 业务分类
CREATE TABLE js_biz_category
(
category_code varchar(64) NOT NULL,
view_code varchar(500),
category_name varchar(64) NOT NULL,
parent_code varchar(64) NOT NULL,
parent_codes varchar(767) NOT NULL,
tree_sort decimal(10) NOT NULL,
tree_sorts varchar(767) NOT NULL,
tree_leaf char(1) NOT NULL,
tree_level decimal(4) NOT NULL,
tree_names varchar(767) NOT NULL,
status char(1) DEFAULT '0' NOT NULL,
create_by varchar(64) NOT NULL,
create_date timestamp NOT NULL,
update_by varchar(64) NOT NULL,
update_date timestamp NOT NULL,
remarks varchar(500),
corp_code varchar(64) DEFAULT '0' NOT NULL,
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
PRIMARY KEY (category_code)
) WITHOUT OIDS;
-- 公司表
CREATE TABLE js_sys_company
(
@@ -492,6 +492,21 @@ CREATE TABLE js_sys_menu
) WITHOUT OIDS;
-- 菜单数据权限
CREATE TABLE js_sys_menu_data_scope
(
id varchar(64) NOT NULL,
role_code varchar(64) NOT NULL,
menu_code varchar(64) NOT NULL,
rule_name varchar(100),
rule_type char(1),
rule_config text,
status char(1),
remarks varchar(500),
PRIMARY KEY (id)
) WITHOUT OIDS;
-- 模块表
CREATE TABLE js_sys_module
(
@@ -767,7 +782,8 @@ CREATE TABLE js_sys_role_data_scope
ctrl_type varchar(20) NOT NULL,
ctrl_data varchar(64) NOT NULL,
ctrl_permi varchar(64) NOT NULL,
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi)
menu_code varchar(64) DEFAULT '0' NOT NULL,
PRIMARY KEY (role_code, ctrl_type, ctrl_data, ctrl_permi, menu_code)
) WITHOUT OIDS;
@@ -934,6 +950,8 @@ CREATE INDEX idx_sys_menu_sc ON js_sys_menu (sys_code);
CREATE INDEX idx_sys_menu_is ON js_sys_menu (is_show);
CREATE INDEX idx_sys_menu_mcs ON js_sys_menu (module_codes);
CREATE INDEX idx_sys_menu_wt ON js_sys_menu (weight);
CREATE INDEX idx_sys_menu_ds_mc ON js_sys_menu_data_scope (menu_code);
CREATE INDEX idx_sys_menu_ds_rc ON js_sys_menu_data_scope (role_code);
CREATE INDEX idx_sys_module_status ON js_sys_module (status);
CREATE INDEX idx_sys_msg_inner_cb ON js_sys_msg_inner (create_by);
CREATE INDEX idx_sys_msg_inner_status ON js_sys_msg_inner (status);
@@ -999,6 +1017,25 @@ CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code);
/* Comments */
COMMENT ON TABLE js_biz_category IS '业务分类';
COMMENT ON COLUMN js_biz_category.category_code IS '流程分类';
COMMENT ON COLUMN js_biz_category.view_code IS '分类代码';
COMMENT ON COLUMN js_biz_category.category_name IS '分类名称';
COMMENT ON COLUMN js_biz_category.parent_code IS '父级编号';
COMMENT ON COLUMN js_biz_category.parent_codes IS '所有父级编号';
COMMENT ON COLUMN js_biz_category.tree_sort IS '排序号(升序)';
COMMENT ON COLUMN js_biz_category.tree_sorts IS '所有排序号';
COMMENT ON COLUMN js_biz_category.tree_leaf IS '是否最末级';
COMMENT ON COLUMN js_biz_category.tree_level IS '层次级别';
COMMENT ON COLUMN js_biz_category.tree_names IS '全节点名';
COMMENT ON COLUMN js_biz_category.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_biz_category.create_by IS '创建者';
COMMENT ON COLUMN js_biz_category.create_date IS '创建时间';
COMMENT ON COLUMN js_biz_category.update_by IS '更新者';
COMMENT ON COLUMN js_biz_category.update_date IS '更新时间';
COMMENT ON COLUMN js_biz_category.remarks IS '备注信息';
COMMENT ON COLUMN js_biz_category.corp_code IS '租户代码';
COMMENT ON COLUMN js_biz_category.corp_name IS '租户名称';
COMMENT ON TABLE js_gen_table IS '代码生成表';
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
@@ -1058,25 +1095,6 @@ COMMENT ON COLUMN js_sys_area.create_date IS '创建时间';
COMMENT ON COLUMN js_sys_area.update_by IS '更新者';
COMMENT ON COLUMN js_sys_area.update_date IS '更新时间';
COMMENT ON COLUMN js_sys_area.remarks IS '备注信息';
COMMENT ON TABLE js_biz_category IS '业务分类';
COMMENT ON COLUMN js_biz_category.category_code IS '流程分类';
COMMENT ON COLUMN js_biz_category.view_code IS '分类代码';
COMMENT ON COLUMN js_biz_category.category_name IS '分类名称';
COMMENT ON COLUMN js_biz_category.parent_code IS '父级编号';
COMMENT ON COLUMN js_biz_category.parent_codes IS '所有父级编号';
COMMENT ON COLUMN js_biz_category.tree_sort IS '排序号(升序)';
COMMENT ON COLUMN js_biz_category.tree_sorts IS '所有排序号';
COMMENT ON COLUMN js_biz_category.tree_leaf IS '是否最末级';
COMMENT ON COLUMN js_biz_category.tree_level IS '层次级别';
COMMENT ON COLUMN js_biz_category.tree_names IS '全节点名';
COMMENT ON COLUMN js_biz_category.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_biz_category.create_by IS '创建者';
COMMENT ON COLUMN js_biz_category.create_date IS '创建时间';
COMMENT ON COLUMN js_biz_category.update_by IS '更新者';
COMMENT ON COLUMN js_biz_category.update_date IS '更新时间';
COMMENT ON COLUMN js_biz_category.remarks IS '备注信息';
COMMENT ON COLUMN js_biz_category.corp_code IS '租户代码';
COMMENT ON COLUMN js_biz_category.corp_name IS '租户名称';
COMMENT ON TABLE js_sys_company IS '公司表';
COMMENT ON COLUMN js_sys_company.company_code IS '公司编码';
COMMENT ON COLUMN js_sys_company.view_code IS '公司代码';
@@ -1375,6 +1393,15 @@ COMMENT ON COLUMN js_sys_menu.extend_d2 IS '扩展 Date 2';
COMMENT ON COLUMN js_sys_menu.extend_d3 IS '扩展 Date 3';
COMMENT ON COLUMN js_sys_menu.extend_d4 IS '扩展 Date 4';
COMMENT ON COLUMN js_sys_menu.extend_json IS '扩展 JSON';
COMMENT ON TABLE js_sys_menu_data_scope IS '菜单数据权限';
COMMENT ON COLUMN js_sys_menu_data_scope.id IS '编号';
COMMENT ON COLUMN js_sys_menu_data_scope.role_code IS '角色编码';
COMMENT ON COLUMN js_sys_menu_data_scope.menu_code IS '菜单编码';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_name IS '规则名称';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_type IS '规则类型1 角色数据范围 2自定义条件规则 3自定义SQL';
COMMENT ON COLUMN js_sys_menu_data_scope.rule_config IS '规则配置JSON';
COMMENT ON COLUMN js_sys_menu_data_scope.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN js_sys_menu_data_scope.remarks IS '备注信息';
COMMENT ON TABLE js_sys_module IS '模块表';
COMMENT ON COLUMN js_sys_module.module_code IS '模块编码';
COMMENT ON COLUMN js_sys_module.module_name IS '模块名称';
@@ -1551,7 +1578,7 @@ COMMENT ON COLUMN js_sys_role.is_sys IS '系统内置1是 0否';
COMMENT ON COLUMN js_sys_role.is_show IS '是否显示';
COMMENT ON COLUMN js_sys_role.user_type IS '用户类型employee员工 member会员';
COMMENT ON COLUMN js_sys_role.desktop_url IS '桌面地址(仪表盘地址)';
COMMENT ON COLUMN js_sys_role.data_scope IS '数据范围设置0未设置 1全部数据 2自定义数据';
COMMENT ON COLUMN js_sys_role.data_scope IS '数据范围0未设置 1全部数据 2自定义数据';
COMMENT ON COLUMN js_sys_role.biz_scope IS '适应业务范围(不同的功能,不同的数据权限支持)';
COMMENT ON COLUMN js_sys_role.sys_codes IS '包含系统(多个用逗号隔开)';
COMMENT ON COLUMN js_sys_role.status IS '状态0正常 1删除 2停用';
@@ -1588,6 +1615,7 @@ COMMENT ON COLUMN js_sys_role_data_scope.role_code IS '控制角色编码';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_type IS '控制类型';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_data IS '控制数据';
COMMENT ON COLUMN js_sys_role_data_scope.ctrl_permi IS '控制权限';
COMMENT ON COLUMN js_sys_role_data_scope.menu_code IS '菜单编码';
COMMENT ON TABLE js_sys_role_menu IS '角色与菜单关联表';
COMMENT ON COLUMN js_sys_role_menu.role_code IS '角色编码';
COMMENT ON COLUMN js_sys_role_menu.menu_code IS '菜单编码';

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.9.2-SNAPSHOT</version>
<version>5.12.1-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -30,19 +30,19 @@
<scope>runtime</scope>
</dependency>
<!-- Oracle 11g -->
<!-- Oracle 11g
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
<scope>runtime</scope>
</dependency>
<!-- Oracle 12c 及以上版本
</dependency> -->
<!-- Oracle 12c 及以上版本 -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>runtime</scope>
</dependency> -->
</dependency>
<!-- SqlServer 2008
<dependency>
@@ -71,19 +71,21 @@
<scope>runtime</scope>
</dependency> -->
<!-- 达梦数据库
<!-- 达梦数据库 -->
<dependency>
<groupId>com.dameng</groupId>
<artifactId>Dm8JdbcDriver18</artifactId>
<version>8.1.1.49</version>
</dependency> -->
<artifactId>DmJdbcDriver18</artifactId>
<version>8.1.3.62</version>
<scope>runtime</scope>
</dependency>
<!-- 人大金仓数据库
<!-- 人大金仓数据库 -->
<dependency>
<groupId>com.kingbase</groupId>
<artifactId>kingbasejdbc8</artifactId>
<version>8.6.0</version>
</dependency> -->
<groupId>cn.com.kingbase</groupId>
<artifactId>kingbase8</artifactId>
<version>8.6.1</version>
<scope>runtime</scope>
</dependency>
<!-- Web Server -->
<dependency>

View File

@@ -8,6 +8,7 @@ import com.jeesite.common.codec.DesUtils;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.collect.SetUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.ObjectUtils;
import com.jeesite.common.lang.StringUtils;
@@ -40,6 +41,7 @@ import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
/**
* 表单验证(包含验证码)过滤类
@@ -52,8 +54,12 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
public static final String MESSAGE_PARAM = "message"; // 登录返回消息
public static final String REMEMBER_USERCODE_PARAM = "rememberUserCode"; // 记住用户名
public static final String EXCEPTION_ATTRIBUTE_NAME = "exception"; // 异常类属性名
public static final String LOGIN_PARAM = "__login"; // 支持GET方式登录的参数
public static final String LOGIN_PARAM = "__login"; // 支持GET方式登录的参数
public static final Boolean POST_ROLE_PERMI = Global.getConfigToBoolean("user.postRolePermi", "false");
public static final Boolean SWITCH_OFFICE = Global.getConfigToBoolean("user.switchOffice", "false");
public static final Boolean LOGIN_AFTER_ACTIVE_MAIN_OFFICE = Global.getConfigToBoolean("user.loginAfterActiveMainOffice", "false");
private static final Logger logger = LoggerFactory.getLogger(FormFilter.class);
private static FormFilter instance;
@@ -425,6 +431,8 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
data.put("company", Global.getProperty("companyName"));
data.put("version", Global.getProperty("productVersion"));
data.put("year", Global.getProperty("copyrightYear"));
data.put("lang", Global.getLang(request));
data.put("timeZone", Global.getTimeZone(request));
}
/**
@@ -452,9 +460,11 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
data.put("company", Global.getProperty("companyName"));
data.put("version", Global.getProperty("productVersion"));
data.put("year", Global.getProperty("copyrightYear"));
data.put("lang", Global.getLang());
data.put("lang", Global.getLang(request));
data.put("timeZone", Global.getTimeZone(request));
List<Map<String, Object>> roleList = ListUtils.newArrayList();
String desktopUrl = null;
String desktopUrl = null; String roleCode = (String)session.getAttribute("roleCode");
Set<String> roleCodes = roleCode != null ? SetUtils.newHashSet(StringUtils.splitComma(roleCode)) : null;
for (Role role : user.getRoleList()){
Map<String, Object> roleMap = MapUtils.newHashMap();
roleMap.put("roleCode", role.getRoleCode());
@@ -462,14 +472,21 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
roleMap.put("isShow", role.getIsShow());
roleMap.put("sysCodes", role.getSysCodes());
roleList.add(roleMap);
if (desktopUrl == null && StringUtils.isNotBlank(role.getDesktopUrl())) {
desktopUrl = role.getDesktopUrl();
// 根据当前身份,选择桌面地址(先得到先受用)
if (desktopUrl == null) {
if (roleCodes != null){
if (roleCodes.contains(role.getRoleCode()) && StringUtils.isNotBlank(role.getDesktopUrl())) {
desktopUrl = role.getDesktopUrl();
}
}else if (StringUtils.isNotBlank(role.getDesktopUrl())) {
desktopUrl = role.getDesktopUrl();
}
}
}
data.put("roleList", roleList);
List<Map<String, Object>> postList = ListUtils.newArrayList();
if (Global.getConfigToBoolean("user.postRolePermi", "false")
&& User.USER_TYPE_EMPLOYEE.equals(user.getUserType())) {
if (POST_ROLE_PERMI && User.USER_TYPE_EMPLOYEE.equals(user.getUserType())) {
List<Map<String, Object>> postList = ListUtils.newArrayList();
data.put("postRolePermi", "true");
Employee employee = user.getRefObj();
for (EmployeePost ep : EmpUtils.getEmployeePostList(employee.getEmpCode())){
Post post = ep.getPost();
@@ -480,8 +497,15 @@ public class FormFilter extends org.apache.shiro.web.filter.authc.FormAuthentica
postList.add(postMap);
}
}
data.put("postList", postList);
}
if (SWITCH_OFFICE && User.USER_TYPE_EMPLOYEE.equals(user.getUserType())) {
data.put("switchOffice", "true");
// 登录后指定当前部门,即当前部门权限,否则为混合权限
data.put("officeCode", LOGIN_AFTER_ACTIVE_MAIN_OFFICE ? EmpUtils.getCurrentOfficeCode()
: session.getAttribute("officeCode"));
data.put("officeName", EmpUtils.getCurrentOfficeName());
}
data.put("postList", postList);
data.put("desktopUrl", desktopUrl != null ? desktopUrl : Global.getConfig("sys.index.desktopUrl"));
return data;
}

View File

@@ -6,7 +6,7 @@ package com.jeesite.common.shiro.realm;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.codec.SM3Utils;
import com.jeesite.common.codec.Sha1Utils;
import com.jeesite.common.codec.ShaUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.shiro.authc.FormToken;
import com.jeesite.common.utils.SpringUtils;
@@ -31,7 +31,6 @@ import javax.servlet.http.HttpServletRequest;
*/
public class AuthorizingRealm extends BaseAuthorizingRealm {
public static final String HASH_ALGORITHM = "SHA-1";
public static final int HASH_ITERATIONS = 1024;
public static final int SALT_SIZE = 8;
@@ -89,7 +88,7 @@ public class AuthorizingRealm extends BaseAuthorizingRealm {
String data = SM3Utils.sm3(plain, salt, HASH_ITERATIONS);
return salt + data;
}
String data = Sha1Utils.sha1(plain, salt, HASH_ITERATIONS);
String data = ShaUtils.sha1(plain, salt, HASH_ITERATIONS);
return salt + data;
}
@@ -108,7 +107,7 @@ public class AuthorizingRealm extends BaseAuthorizingRealm {
String data = SM3Utils.sm3(plain, salt, HASH_ITERATIONS);
return password.equals(salt + data);
}
String data = Sha1Utils.sha1(plain, salt, HASH_ITERATIONS);
String data = ShaUtils.sha1(plain, salt, HASH_ITERATIONS);
return password.equals(salt + data);
}catch(Exception e){
return false;

View File

@@ -72,13 +72,14 @@ public class ActionEnter {
state = new Uploader(request, conf).doExec();
break;
case ActionMap.CATCH_IMAGE:
if (Global.isDemoMode()) {
state = new BaseState(false, "演示模式,不允许操作!");
break;
}
conf = configManager.getConfig(actionCode);
String[] list = this.request.getParameterValues((String) conf.get("fieldName"));
state = new ImageHunter(request, conf).capture(list);
// if (Global.isDemoMode()) {
// state = new BaseState(false, "演示模式,不允许操作!");
// break;
// }
// conf = configManager.getConfig(actionCode);
// String[] list = this.request.getParameterValues((String) conf.get("fieldName"));
// state = new ImageHunter(request, conf).capture(list);
state = new BaseState(false, "该功能暂不提供支持");
break;
case ActionMap.LIST_IMAGE:
case ActionMap.LIST_FILE:

View File

@@ -71,6 +71,14 @@ public class BizCategory extends TreeEntity<BizCategory> {
this.viewCode = viewCode;
}
public String getViewCode_like() {
return sqlMap().getWhere().getValue("view_code", QueryType.LIKE);
}
public void setViewCode_like(String viewCode) {
sqlMap().getWhere().and("view_code", QueryType.LIKE, viewCode);
}
@NotBlank(message="分类名称不能为空")
@Size(min=0, max=64, message="分类名称长度不能超过 64 个字符")
public String getCategoryName() {

View File

@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@@ -43,7 +44,10 @@ public class BizCategoryController extends BaseController {
* 获取数据
*/
@ModelAttribute
public BizCategory get(String categoryCode, boolean isNewRecord) {
public BizCategory get(String categoryCode, boolean isNewRecord, HttpServletRequest request) {
if (StringUtils.endsWith(request.getRequestURI(), "listData")) {
return new BizCategory();
}
return bizCategoryService.get(categoryCode, isNewRecord);
}
@@ -77,13 +81,11 @@ public class BizCategoryController extends BaseController {
if (StringUtils.isBlank(bizCategory.getParentCode())) {
bizCategory.setParentCode(BizCategory.ROOT_CODE);
}
if (StringUtils.isNotBlank(bizCategory.getViewCode())) {
bizCategory.setParentCode(null);
}
if (StringUtils.isNotBlank(bizCategory.getCategoryName())){
bizCategory.setParentCode(null);
}
if (StringUtils.isNotBlank(bizCategory.getRemarks())){
if (StringUtils.isNotBlank(bizCategory.getCategoryCode())
|| StringUtils.isNotBlank(bizCategory.getViewCode())
|| StringUtils.isNotBlank(bizCategory.getViewCode_like())
|| StringUtils.isNotBlank(bizCategory.getCategoryName())
|| StringUtils.isNotBlank(bizCategory.getRemarks())){
bizCategory.setParentCode(null);
}
List<BizCategory> list = bizCategoryService.findList(bizCategory);
@@ -151,7 +153,7 @@ public class BizCategoryController extends BaseController {
public String disable(BizCategory bizCategory) {
BizCategory where = new BizCategory();
where.setStatus(BizCategory.STATUS_NORMAL);
where.setParentCodes("," + bizCategory.getId() + ",");
where.setParentCodes_rightLike(bizCategory.getParentCodes() + bizCategory.getId() + ",");
long count = bizCategoryService.findCount(where);
if (count > 0) {
return renderResult(Global.FALSE, text("该业务分类包含未停用的子业务分类!"));

View File

@@ -1,51 +0,0 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.config.server;
import javax.servlet.Filter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
/**
* 将请求协议转换为 https
* @author ThinkGem
* @version 2020年1月21日
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(name="server.schemeHttps", havingValue="true", matchIfMissing=false)
public class SchemeHttpsConfig {
@Bean
public FilterRegistrationBean<Filter> schemeHttpsFilter() {
FilterRegistrationBean<Filter> bean = new FilterRegistrationBean<>();
bean.setName("schemeHttpsFilter");
bean.setFilter((request, response, chain) -> {
chain.doFilter(new HttpServletRequestWrapper((HttpServletRequest) request) {
@Override
public String getScheme() {
return "https";
}
@Override
public StringBuffer getRequestURL() {
StringBuffer sb = super.getRequestURL();
if ("http:".equals(sb.substring(0, 5))){
return sb.replace(0, 5, "https:");
}else{
return sb;
}
}
}, response);
});
bean.addUrlPatterns("/*");
return bean;
}
}

View File

@@ -6,11 +6,13 @@ package com.jeesite.modules.config.web;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.utils.LocaleUtils;
import com.jeesite.common.web.http.ServletUtils;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.LocaleContextResolver;
import javax.servlet.Filter;
import javax.servlet.ServletRequest;
@@ -28,7 +30,7 @@ public class IpAddrFilterConfig {
private static String[] denyPrefixes;
@Bean
public FilterRegistrationBean<Filter> ipAddrFilter() {
public FilterRegistrationBean<Filter> ipAddrFilter(LocaleContextResolver localeResolver) {
FilterRegistrationBean<Filter> bean = new FilterRegistrationBean<>();
bean.setName("ipAddrFilter");
bean.setOrder(Ordered.HIGHEST_PRECEDENCE + 10);
@@ -40,7 +42,9 @@ public class IpAddrFilterConfig {
response.setStatus(403);
ServletUtils.renderString(response, Global.getText("访问拒绝"));
}
LocaleUtils.removeTimeZoneAwareLocaleContext();
});
LocaleUtils.setLocaleResolver(localeResolver);
bean.addUrlPatterns("/*");
return bean;
}

View File

@@ -35,7 +35,7 @@ public class FileUploadController extends BaseController {
@Autowired
private FileUploadService fileUploadService;
/**
* 上传文件参数
*/
@@ -53,7 +53,7 @@ public class FileUploadController extends BaseController {
model.put("imageMaxHeight", Global.getConfigToInteger("file.imageMaxHeight", "768"));
return model;
}
/**
* 上传文件
*/
@@ -62,14 +62,14 @@ public class FileUploadController extends BaseController {
public Map<String, Object> uploadFile(FileUploadParams params) {
return fileUploadService.uploadFile(new FileUpload(), params);
}
/**
* 下载文件
*/
@RequestMapping(value = "/download/{fileUploadId}")
public String downloadFile(@PathVariable("fileUploadId") String fileUploadId, String preview, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
FileUpload fileUpload = fileUploadService.getFile(new FileUpload(fileUploadId));
return fileUploadService.downloadFile(fileUpload, preview, request, response);
return fileUploadService.downloadFile(fileUpload, preview, "file", request, response);
}
/**

View File

@@ -33,7 +33,7 @@ import java.io.IOException;
public class UserfilesController extends BaseController {
@RequestMapping(value="/userfiles/**")
public String fileStreamDown(HttpServletRequest request, HttpServletResponse response)
public String fileStreamDown(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// 获取相对文件地址
@@ -49,7 +49,8 @@ public class UserfilesController extends BaseController {
String uid = request.getParameter("uid");
if (StringUtils.isNotBlank(url) && StringUtils.isNotBlank(uid)){
fileUrl = url; //EncodeUtils.decodeUrl(url); 不用解码,否则腾讯云存储的时候预览不能显示
fileUri = Global.getCtxPath() + Global.getAdminPath() + "/file/download/" + uid;
String type = StringUtils.defaultIfBlank(request.getParameter("type"), "file");
fileUri = Global.getCtxPath() + Global.getAdminPath() + "/" + type + "/download/" + uid;
filePath = fileName;
} else if (StringUtils.isNotBlank(fileName)){
fileUri += "?fileName=" + EncodeUtils.encodeUrl(fileName);

View File

@@ -0,0 +1,82 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
* No deletion without permission, or be held responsible to law.
*/
package com.jeesite.modules.file.web;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.file.entity.FileUpload;
import com.jeesite.modules.file.entity.FileUploadParams;
import com.jeesite.modules.file.utils.FileUploadUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.Map;
/**
* Vditor Controller
* @author ThinkGem
* @version 2025-04-09
*/
@Controller
@RequestMapping(value = "${adminPath}/file/vditor")
@ConditionalOnProperty(name={"file.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
public class VditorController extends BaseController {
@RequestMapping(value = "upload")
@ResponseBody
public Map<String, Object> upload(MultipartFile[] files, String md5s, String bizKey, String bizType, String updateType) {
Map<String, Object> result = new HashMap<>();
result.put("code", 0);
if (files == null || files.length == 0 || StringUtils.isAnyBlank(md5s, bizKey, bizType)) {
result.put("msg", text("上传的文件不能为空"));
return result;
}
String[] fileMd5s = StringUtils.splitComma(md5s);
if (fileMd5s.length != files.length) {
result.put("msg", text("文件校验码与文件的长度不等"));
return result;
}
Map<String, Object> data = new HashMap<>();
Map<String, String> succMap = new HashMap<>();
Map<String, String> errFiles = new HashMap<>();
for (int i = 0; i < files.length; i++) {
MultipartFile file = files[i];
FileUploadParams params = new FileUploadParams();
params.setFileMd5(fileMd5s[i]);
params.setFileName(file.getOriginalFilename());
params.setBizKey(bizKey);
params.setBizType(bizType);
params.setUploadType(updateType);
params.setFile(file);
Map<String, Object> res = FileUploadUtils.saveFileUpload(params);
if (Global.FALSE.equals(res.get("result"))) {
errFiles.put(params.getFileName(), (String)res.get("message"));
} else {
FileUpload fileUpload = (FileUpload)res.get("fileUpload");
succMap.put(params.getFileName(), Global.getCtxPath() + fileUpload.getFileUrl());
}
}
if (!errFiles.isEmpty()) {
result.put("code", 1);
if (errFiles.size() == files.length) {
result.put("msg", StringUtils.join(errFiles.values(), "; "));
} else {
result.put("msg", text("部分上传失败:") + StringUtils.join(errFiles.values(), "; "));
}
data.put("errFiles", errFiles.keySet());
} else {
result.put("msg", text("上传的文件成功"));
data.put("succMap", succMap);
}
result.put("data", data);
return result;
}
}

View File

@@ -37,6 +37,11 @@ public interface EmpUserDao extends CrudDao<EmpUser> {
* 根据部门编码查询用户,仅返回基本信息
*/
List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
/**
* 根据公司编码查询用户,仅返回基本信息
*/
List<EmpUser> findUserListByCompanyCodes(EmpUser empUser);
/**
* 根据角色编码查询用户,仅返回基本信息

View File

@@ -338,6 +338,7 @@ public class InitCoreData extends BaseInitDataTests {
job.setConcurrent(Global.NO);
job.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING);
job.setStatus(JobEntity.STATUS_PAUSED);
job.setRemarks("实时推送和设定计划推送时间的定时推送消息。");
jobDao.insert(job);
job = new JobEntity(MsgLocalMergePushTask.class.getSimpleName(), "SYSTEM");
job.setDescription("消息推送服务 (合并推送)");
@@ -346,6 +347,19 @@ public class InitCoreData extends BaseInitDataTests {
job.setConcurrent(Global.NO);
job.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING);
job.setStatus(JobEntity.STATUS_PAUSED);
job.setRemarks("不重要的通知进行汇总30分钟或更长执行一次将多条消息合并为一条消息延迟推送给用户。");
jobDao.insert(job);
job = new JobEntity("DeleteLogBefore", "SYSTEM");
job.setDescription("清理访问日志 (3个月前)");
job.setInvokeTarget("logService.deleteLogBefore(0, 3, 0)");
job.setCronExpression("0 0 0 1 1/1 ? *");
job.setConcurrent(Global.NO);
job.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING);
job.setStatus(JobEntity.STATUS_PAUSED);
job.setRemarks("1、清理1年前的所有日志logService.deleteLogBefore(1, 0, 0)\n" +
"2、清理6个月前的所有日志logService.deleteLogBefore(0, 6, 0)\n" +
"3、清理7天前的所有日志logService.deleteLogBefore(0, 0, 7)\n" +
"4、清理1年6个月前的所有日志logService.deleteLogBefore(1, 6, 0)");
jobDao.insert(job);
}

View File

@@ -4,15 +4,15 @@
*/
package com.jeesite.modules.sys.entity;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 行政区划Entity
* @author ThinkGem
@@ -59,6 +59,14 @@ public class Area extends TreeEntity<Area> {
this.areaCode = areaCode;
}
public String getAreaCode_like() {
return sqlMap().getWhere().getValue("area_code", QueryType.LIKE);
}
public void setAreaCode_like(String areaCode) {
sqlMap().getWhere().and("area_code", QueryType.LIKE, areaCode);
}
@NotBlank(message="名称不能为空")
@Size(min=0, max=100, message="名称长度不能超过 100 个字符")
public String getAreaName() {

View File

@@ -45,7 +45,7 @@ import java.util.List;
@Column(name="area_type", label="区域类型"),
@Column(name="tree_names", label="区域全称"),
}),
}, extWhereKeys="dsf", orderBy="a.tree_sorts, a.company_code"
}, orderBy="a.tree_sorts, a.company_code"
)
public class Company extends TreeEntity<Company> {

View File

@@ -81,9 +81,6 @@ import javax.validation.Valid;
// @Column(name="user_name", attrName="createByName", label="用户名称", isQuery=false),
// }),
},
// extFromKeys="dsfOfficeFrom, dsfCompanyFrom",
// extWhereKeys="dsfOfficeWhere, dsfCompanyWhere",
extWhereKeys="dsfOffice, dsfCompany",
orderBy="a.user_weight DESC, a.update_date DESC"
)
public class EmpUser extends User {

View File

@@ -4,14 +4,13 @@
*/
package com.jeesite.modules.sys.entity;
import javax.validation.constraints.Size;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import javax.validation.constraints.Size;
/**
* 附属机构Entity
@@ -29,7 +28,10 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
columns={
@Column(name="office_code", label="机构编码", isPK=true),
@Column(name="parent_codes",label="所有父级编码", queryType=QueryType.LIKE),
@Column(name="view_code", label="机构代码", isQuery=false),
@Column(name="office_name", label="机构名称", isQuery=false),
@Column(name="full_name", label="机构全称", isQuery=false),
@Column(name="tree_names", label="全节点名", isQuery=false),
}),
@JoinTable(type=Type.LEFT_JOIN, entity=Post.class, alias="p",
on="p.post_code=a.post_code", attrName="this",
@@ -47,7 +49,11 @@ public class EmployeeOffice extends DataEntity<EmployeeOffice> {
private String postCode; // 岗位编码
private String parentCodes; // 机构所有上级编码(数据权限用)
private String viewCode; // 机构代码(联合查询项)
private String officeName; // 机构名称(联合查询项)
private String fullName; // 机构全称(联合查询项)
private String treeNames; // 机构全称(联合查询项)
private String postName; // 岗位名称(联合查询项)
public EmployeeOffice() {
@@ -93,6 +99,14 @@ public class EmployeeOffice extends DataEntity<EmployeeOffice> {
this.parentCodes = parentCodes;
}
public String getViewCode() {
return viewCode;
}
public void setViewCode(String viewCode) {
this.viewCode = viewCode;
}
public String getOfficeName() {
return officeName;
}
@@ -101,6 +115,22 @@ public class EmployeeOffice extends DataEntity<EmployeeOffice> {
this.officeName = officeName;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getTreeNames() {
return treeNames;
}
public void setTreeNames(String treeNames) {
this.treeNames = treeNames;
}
public String getPostName() {
return postName;
}

View File

@@ -42,7 +42,7 @@ import javax.validation.constraints.Size;
@Column(name="zip_code", attrName="zipCode", label="邮政编码", queryType=QueryType.LIKE),
@Column(name="email", attrName="email", label="邮箱", queryType=QueryType.LIKE),
@Column(includeEntity=Extend.class, attrName="extend"),
}, extWhereKeys="dsf", orderBy="a.tree_sorts, a.office_code"
}, orderBy="a.tree_sorts, a.office_code"
)
public class Office extends TreeEntity<Office> {
@@ -64,7 +64,7 @@ public class Office extends TreeEntity<Office> {
@ExcelFields({
@ExcelField(title="上级编码", attrName="parentCode", align=Align.LEFT, sort=10),
@ExcelField(title="机构编码", attrName="officeCode", align=Align.LEFT, sort=20),
@ExcelField(title="显示编", attrName="viewCode", align = Align.LEFT, sort=30),
@ExcelField(title="机构代", attrName="viewCode", align = Align.LEFT, sort=30),
@ExcelField(title="机构名称", attrName="officeName", align=Align.LEFT, sort=40),
@ExcelField(title="机构全称", attrName="fullName", align=Align.LEFT, sort=50),
@ExcelField(title="机构类型", attrName="officeType", align=Align.CENTER, sort=60, dictType="sys_office_type"),

View File

@@ -8,6 +8,7 @@ import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
/**
* 岗位角色Entity
@@ -53,6 +54,14 @@ public class PostRole extends DataEntity<PostRole> {
this.postCode = postCode;
}
public String[] getPostCode_in(){
return sqlMap.getWhere().getValue("post_code", QueryType.IN);
}
public void setPostCode_in(String[] postCodes){
sqlMap.getWhere().and("post_code", QueryType.IN, postCodes);
}
public String getRoleCode() {
return roleCode;
}

View File

@@ -47,6 +47,11 @@ public interface EmpUserService extends CrudServiceApi<EmpUser> {
* 根据部门编码查询用户,仅返回基本信息
*/
List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
/**
* 根据公司编码查询用户,仅返回基本信息
*/
List<EmpUser> findUserListByCompanyCodes(EmpUser empUser);
/**
* 根据角色编码查询用户,仅返回基本信息

View File

@@ -5,15 +5,19 @@
package com.jeesite.modules.sys.service.support;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.service.TreeService;
import com.jeesite.common.utils.PageUtils;
import com.jeesite.modules.sys.dao.CompanyDao;
import com.jeesite.modules.sys.dao.CompanyOfficeDao;
import com.jeesite.modules.sys.entity.Company;
import com.jeesite.modules.sys.entity.CompanyOffice;
import com.jeesite.modules.sys.entity.EmpUser;
import com.jeesite.modules.sys.service.CompanyService;
import com.jeesite.modules.sys.service.DataScopeService;
import com.jeesite.modules.sys.service.EmpUserService;
import com.jeesite.modules.sys.utils.EmpUtils;
import org.apache.commons.lang3.StringUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@@ -29,9 +33,10 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
@Autowired
private CompanyOfficeDao companyOfficeDao;
@Autowired
private DataScopeService dataScopeService;
@Autowired
private EmpUserService empUserService;
/**
* 获取单条数据
@@ -86,7 +91,7 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
companyOfficeDao.insertBatch(list, null);
}
// 清理公司相关缓存
clearCompanyCache();
clearCompanyCache(company);
}
/**
@@ -95,9 +100,10 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
@Override
@Transactional
public void delete(Company company) {
company.sqlMap().markIdDelete();
super.delete(company);
// 清理公司相关缓存
clearCompanyCache();
clearCompanyCache(company);
}
/**
@@ -108,15 +114,37 @@ public class CompanyServiceSupport extends TreeService<CompanyDao, Company>
public void updateStatus(Company company) {
dao.updateStatus(company);
// 清理公司相关缓存
clearCompanyCache();
clearCompanyCache(company);
}
/**
* 清理公司相关缓存
*/
private void clearCompanyCache(){
// EmpUtils.removeCache(EmpUtils.CACHE_COMPANY_LIST);
private void clearCompanyCache(Company company){
EmpUtils.removeCache(EmpUtils.CACHE_COMPANY_ALL_LIST);
// 清理公司下的用户缓存,包含子公司
if (company == null || StringUtils.isBlank(company.getCompanyCode())){
return;
}
if (StringUtils.isBlank(company.getParentCode())){
company = get(company);
if (company == null){
return;
}
}
Company where = new Company();
where.setStatus(Company.STATUS_NORMAL);
where.setParentCodes(company.getParentCodes() + company.getCompanyCode() + ",%");
EmpUser empUserWhere = new EmpUser();
empUserWhere.setCodes(this.findByParentCodesLike(where).stream().map(Company::getCompanyCode).toArray(String[]::new));
if (empUserWhere.getCodes().length == 0) {
return;
}
PageUtils.findList(empUserWhere, null, e -> {
List<EmpUser> empUserList = empUserService.findUserListByCompanyCodes((EmpUser)e);
empUserList.forEach(UserUtils::clearCache);
return !empUserList.isEmpty();
});
}
}

View File

@@ -78,6 +78,10 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
empUser.sqlMap().getDataScope().addFilter("dsfCompany",
"Company", "e.company_code", "a.create_by", ctrlPermi, "office_user");
}
// empUser.sqlMap().getDataScope().addFilterByPermission("dsfOffice", "sys:empUser:view",
// "Office", "e.office_code", "a.create_by", ctrlPermi);
// empUser.sqlMap().getDataScope().addFilterByPermission("dsfOffice", "sys:empUser:view",
// "User", "a.user_code", ctrlPermi);
}
/**
@@ -111,6 +115,13 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser){
return dao.findUserListByOfficeCodes(empUser);
}
/**
* 根据公司编码查询用户,仅返回基本信息
*/
@Override
public List<EmpUser> findUserListByCompanyCodes(EmpUser empUser){
return dao.findUserListByCompanyCodes(empUser);
}
/**
* 根据角色编码查询用户,仅返回基本信息

View File

@@ -106,6 +106,9 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
*/
@Override
public List<EmployeePost> findEmployeePostList(Employee employee){
if (StringUtils.isBlank(employee.getEmpCode())){
return ListUtils.newArrayList();
}
EmployeePost employeePost = new EmployeePost();
employeePost.setEmpCode(employee.getEmpCode());
if (employee.getDataMap() != null) {
@@ -122,6 +125,9 @@ public class EmployeeServiceSupport extends CrudService<EmployeeDao, Employee>
*/
@Override
public List<EmployeeOffice> findEmployeeOfficeList(Employee employee){
if (StringUtils.isBlank(employee.getEmpCode())){
return ListUtils.newArrayList();
}
EmployeeOffice employeeOffice = new EmployeeOffice();
employeeOffice.setEmpCode(employee.getEmpCode());
return employeeOfficeDao.findList(employeeOffice);

View File

@@ -5,15 +5,20 @@
package com.jeesite.modules.sys.service.support;
import com.jeesite.common.config.Global;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.service.ServiceException;
import com.jeesite.common.service.TreeService;
import com.jeesite.common.utils.PageUtils;
import com.jeesite.common.utils.excel.ExcelImport;
import com.jeesite.common.validator.ValidatorUtils;
import com.jeesite.modules.sys.dao.OfficeDao;
import com.jeesite.modules.sys.entity.EmpUser;
import com.jeesite.modules.sys.entity.Office;
import com.jeesite.modules.sys.service.DataScopeService;
import com.jeesite.modules.sys.service.EmpUserService;
import com.jeesite.modules.sys.service.OfficeService;
import com.jeesite.modules.sys.utils.EmpUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@@ -32,6 +37,8 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
@Autowired
private DataScopeService dataScopeService;
@Autowired
private EmpUserService empUserService;
/**
* 获取单条数据
@@ -48,6 +55,8 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
public void addDataScopeFilter(Office office, String ctrlPermi) {
office.sqlMap().getDataScope().addFilter("dsf", "Office", "a.office_code",
null, ctrlPermi , "office_user");
// office.sqlMap().getDataScope().addFilterByPermission("dsf", "sys:empUser:view",
// "Office", "a.office_code", ctrlPermi);
}
/**
@@ -72,7 +81,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
}
super.save(office);
// 清理部门相关缓存
clearOfficeCache();
clearOfficeCache(office);
}
/**
@@ -147,7 +156,7 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
public void updateStatus(Office office) {
super.updateStatus(office);
// 清理部门相关缓存
clearOfficeCache();
clearOfficeCache(office);
}
/**
@@ -159,15 +168,37 @@ public class OfficeServiceSupport extends TreeService<OfficeDao, Office>
office.sqlMap().markIdDelete();
super.delete(office);
// 清理部门相关缓存
clearOfficeCache();
clearOfficeCache(office);
}
/**
* 清理部门相关缓存
*/
private void clearOfficeCache(){
// EmpUtils.removeCache(EmpUtils.CACHE_OFFICE_LIST);
private void clearOfficeCache(Office office){
EmpUtils.removeCache(EmpUtils.CACHE_OFFICE_ALL_LIST);
// 清理组织下的用户缓存,包含子机构
if (office == null || StringUtils.isBlank(office.getOfficeCode())){
return;
}
if (StringUtils.isBlank(office.getParentCode())){
office = get(office);
if (office == null){
return;
}
}
Office where = new Office();
where.setStatus(Office.STATUS_NORMAL);
where.setParentCodes(office.getParentCodes() + office.getOfficeCode() + ",%");
EmpUser empUserWhere = new EmpUser();
empUserWhere.setCodes(this.findByParentCodesLike(where).stream().map(Office::getOfficeCode).toArray(String[]::new));
if (empUserWhere.getCodes().length == 0) {
return;
}
PageUtils.findList(empUserWhere, null, e -> {
List<EmpUser> empUserList = empUserService.findUserListByOfficeCodes((EmpUser)e);
empUserList.forEach(UserUtils::clearCache);
return !empUserList.isEmpty();
});
}
}

View File

@@ -32,7 +32,8 @@ public class EmpUtils {
// 机构和公司缓存常量
public static final String CACHE_OFFICE_ALL_LIST = "officeAllList";
public static final String CACHE_COMPANY_ALL_LIST = "companyAllList";
public static final String CACHE_COMPANY_OFFICE_LIST = "employeeOfficeList";
public static final String CACHE_EMPLOYEE_OFFICE_LIST = "employeeOfficeList";
public static final String CACHE_EMPLOYEE_POST_LIST = "employeePostList";
// 当前线程部门没有session环境下使用优先级低于session
private static final ThreadLocal<String> currentOfficeCode = new NamedThreadLocal<>("CurrentOfficeCode");
@@ -76,8 +77,7 @@ public class EmpUtils {
*/
public static Employee getByUserCode(String userCode){
User user = UserUtils.get(userCode);
Employee employee = get(user);
return employee;
return get(user);
}
/**
@@ -86,8 +86,7 @@ public class EmpUtils {
*/
public static Employee getByLoginCode(String loginCode){
User user = UserUtils.getByLoginCode(loginCode);
Employee employee = get(user);
return employee;
return get(user);
}
/**
@@ -108,10 +107,10 @@ public class EmpUtils {
* @author ThinkGem
*/
public static List<EmployeeOffice> getEmployeeOfficeList(){
List<EmployeeOffice> list = UserUtils.getCache(CACHE_COMPANY_OFFICE_LIST);
List<EmployeeOffice> list = UserUtils.getCache(CACHE_EMPLOYEE_OFFICE_LIST);
if (list == null){
list = Static.employeeService.findEmployeeOfficeList(getEmployee());
UserUtils.putCache(CACHE_COMPANY_OFFICE_LIST, list);
UserUtils.putCache(CACHE_EMPLOYEE_OFFICE_LIST, list);
}
return list;
}
@@ -144,8 +143,7 @@ public class EmpUtils {
* @author ThinkGem
*/
public static List<Office> getOfficeAllList(){
@SuppressWarnings("unchecked")
List<Office> officeList = (List<Office>)CorpUtils.getCache(CACHE_OFFICE_ALL_LIST);
List<Office> officeList = CorpUtils.getCache(CACHE_OFFICE_ALL_LIST);
if (officeList == null){
Office where = new Office();
where.setStatus(Office.STATUS_NORMAL);
@@ -165,7 +163,7 @@ public class EmpUtils {
getEmployeeOfficeList().forEach(e -> {
list.add(e.getOfficeCode());
});
return list.toArray(new String[list.size()]);
return list.toArray(new String[0]);
}
/**
@@ -174,25 +172,25 @@ public class EmpUtils {
*/
public static String[] getOfficeCodesAndChildren(){
Set<String> list = SetUtils.newLinkedHashSet();
Set<String> parentCodess = SetUtils.newHashSet();
Set<String> parentCodesSet = SetUtils.newHashSet();
Office currentOffice = getOffice();
list.add(currentOffice.getOfficeCode());
parentCodess.add(currentOffice.getParentCodes() + currentOffice.getOfficeCode() + ",");
parentCodesSet.add(currentOffice.getParentCodes() + currentOffice.getOfficeCode() + ",");
// 添加附属机构
getEmployeeOfficeList().forEach(e -> {
list.add(e.getOfficeCode());
parentCodess.add(e.getParentCodes() + e.getOfficeCode() + ",");
parentCodesSet.add(e.getParentCodes() + e.getOfficeCode() + ",");
});
// 查找并添加子机构
getOfficeAllList().forEach(e -> {
for (String parentCodes : parentCodess) {
for (String parentCodes : parentCodesSet) {
if (e.getParentCodes().startsWith(parentCodes)) {
list.add(e.getOfficeCode());
break;
}
}
});
return list.toArray(new String[list.size()]);
return list.toArray(new String[0]);
}
/**
@@ -212,16 +210,18 @@ public class EmpUtils {
}
getEmployeeOfficeList().forEach(e -> {
Office office2 = getOffice(e.getOfficeCode());
if (type.equals(office2.getOfficeType())){
list.add(office2.getOfficeCode());
}else{
Office parent2 = office2.getParentByType(type);
if (parent2 != null){
list.add(parent2.getOfficeCode());
if (office2 != null){
if (type.equals(office2.getOfficeType())){
list.add(office2.getOfficeCode());
} else {
Office parent2 = office2.getParentByType(type);
if (parent2 != null){
list.add(parent2.getOfficeCode());
}
}
}
});
return list.toArray(new String[list.size()]);
return list.toArray(new String[0]);
}
/**
@@ -234,7 +234,7 @@ public class EmpUtils {
getEmployeeOfficeList().forEach(e -> {
list.add(e.getParentCodes());
});
return list.toArray(new String[list.size()]);
return list.toArray(new String[0]);
}
/**
@@ -289,13 +289,22 @@ public class EmpUtils {
return getEmployee().getCompany();
}
/**
* 获取当前员工所有公司编码(数据权限用)
* @author ThinkGem
*/
public static String[] getCompanyCodes(){
List<String> list = ListUtils.newArrayList();
list.add(getCompany().getCompanyCode());
return list.toArray(new String[0]);
}
/**
* 获取当前员工所有的公司
* @author ThinkGem
*/
public static List<Company> getCompanyAllList(){
@SuppressWarnings("unchecked")
List<Company> companyList = (List<Company>)CorpUtils.getCache(CACHE_COMPANY_ALL_LIST);
List<Company> companyList = CorpUtils.getCache(CACHE_COMPANY_ALL_LIST);
if (companyList == null){
Company where = new Company();
where.setStatus(Office.STATUS_NORMAL);
@@ -311,20 +320,43 @@ public class EmpUtils {
*/
public static String[] getCompanyCodesAndChildren(){
Set<String> list = SetUtils.newLinkedHashSet();
Set<String> parentCodess = SetUtils.newHashSet();
Set<String> parentCodesSet = SetUtils.newHashSet();
Company currentCompany = getCompany();
list.add(currentCompany.getCompanyCode());
parentCodess.add(currentCompany.getParentCodes() + currentCompany.getCompanyCode() + ",");
parentCodesSet.add(currentCompany.getParentCodes() + currentCompany.getCompanyCode() + ",");
// 查找并添加子公司
getCompanyAllList().forEach(e -> {
for (String parentCodes : parentCodess) {
for (String parentCodes : parentCodesSet) {
if (e.getParentCodes().startsWith(parentCodes)) {
list.add(e.getCompanyCode());
break;
}
}
});
return list.toArray(new String[list.size()]);
return list.toArray(new String[0]);
}
/**
* 获取当前员工所有上级公司编码(数据权限用)
* @author ThinkGem
*/
public static String[] getCompanyParentCodess(){
List<String> list = ListUtils.newArrayList();
list.add(getCompany().getParentCodes());
return list.toArray(new String[0]);
}
/**
* 获取当前员工岗位(返回岗位编码和名称)
* @return
*/
public static List<EmployeePost> getEmployeePostList(){
List<EmployeePost> list = UserUtils.getCache(CACHE_EMPLOYEE_POST_LIST);
if (list == null){
list = getEmployeePostList(getEmployee().getEmpCode());
UserUtils.putCache(CACHE_EMPLOYEE_POST_LIST, list);
}
return list;
}
/**

View File

@@ -5,6 +5,7 @@
package com.jeesite.modules.sys.web;
import com.jeesite.common.codec.DesUtils;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.config.Global;
@@ -20,10 +21,7 @@ import com.jeesite.modules.sys.service.UserService;
import com.jeesite.modules.sys.utils.PwdUtils;
import com.jeesite.modules.sys.utils.UserUtils;
import com.jeesite.modules.sys.utils.ValidCodeUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import org.apache.shiro.authc.AuthenticationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -69,9 +67,10 @@ public class AccountController extends BaseController{
@ApiImplicitParams({
@ApiImplicitParam(name = "mobile", value = "登录手机号", required = true, paramType="query", type="String"),
@ApiImplicitParam(name = "validCode", value = "图片验证码,防止重复机器人", required = true),
@ApiImplicitParam(name = "corpCode", value = "所属租户"),
})
public String getLoginValidCode(String mobile, String validCode, HttpServletRequest request) {
return getValidCode("login", mobile, validCode, "mobile", request, "登录验证码");
public String getLoginValidCode(String mobile, String validCode, String corpCode, HttpServletRequest request) {
return getValidCode("login", mobile, validCode, "mobile", corpCode, request, "登录验证码");
}
/**
@@ -139,9 +138,10 @@ public class AccountController extends BaseController{
@ApiImplicitParam(name = "loginCode", value = "登录账号", required = true, paramType="query", type="String"),
@ApiImplicitParam(name = "validCode", value = "图片验证码,防止重复机器人", required = true),
@ApiImplicitParam(name = "validType", value = "验证方式mobile、email", required = true),
@ApiImplicitParam(name = "corpCode", value = "所属租户"),
})
public String getFpValidCode(User user, String validCode, String validType, HttpServletRequest request) {
return getValidCode("fp", user.getLoginCode(), validCode, validType, request, "找回密码");
public String getFpValidCode(User user, String validCode, String validType, String corpCode, HttpServletRequest request) {
return getValidCode("fp", user.getLoginCode(), validCode, validType, corpCode, request, "找回密码");
}
/**
@@ -180,7 +180,7 @@ public class AccountController extends BaseController{
* 获取验证码
* @author ThinkGem
*/
private String getValidCode(String type, String loginCode, String validCode, String validType, HttpServletRequest request, String msgTitle) {
private String getValidCode(String type, String loginCode, String validCode, String validType, String corpCode, HttpServletRequest request, String msgTitle) {
// 校验图片验证码,防止重复机器人。
if (!ValidCodeUtils.validate(request, validCode)){
return renderResult(Global.FALSE, text("图片验证码不正确或已失效,请点击图片刷新!"));
@@ -193,6 +193,7 @@ public class AccountController extends BaseController{
if ("login".equals(type)){
User where = new User();
where.setMobile(loginCode);
where.setCorpCode_(corpCode);
where.setStatus(User.STATUS_NORMAL);
List<User> userList = userService.findListByMobile(where);
if (!userList.isEmpty()){
@@ -212,7 +213,7 @@ public class AccountController extends BaseController{
return renderResult(Global.FALSE, text("手机号不正确!"));
}
} else {
u = UserUtils.getByLoginCode(loginCode);
u = UserUtils.getByLoginCode(loginCode, corpCode);
if(u == null){
return renderResult(Global.FALSE, text("登录账号不正确!"));
}
@@ -287,14 +288,15 @@ public class AccountController extends BaseController{
@ApiImplicitParams({
@ApiImplicitParam(name = "loginCode", value = "登录账号", required = true, paramType="query", type="String"),
@ApiImplicitParam(name = "validCode", value = "图片验证码,防止重复机器人", required = true),
@ApiImplicitParam(name = "corpCode", value = "所属租户"),
})
public String getPwdQuestion(String loginCode, String validCode, HttpServletRequest request) {
public String getPwdQuestion(String loginCode, String validCode, String corpCode, HttpServletRequest request) {
// 校验图片验证码,防止重复机器人。
if (!ValidCodeUtils.validate(request, validCode)){
return renderResult(Global.FALSE, text("图片验证码不正确或已失效,请点击图片刷新!"));
}
// 账号是否存在验证
User u = UserUtils.getByLoginCode(loginCode);
User u = UserUtils.getByLoginCode(loginCode, corpCode);
if (u == null){
return renderResult(Global.FALSE, text("登录账号不正确!"));
}
@@ -340,7 +342,7 @@ public class AccountController extends BaseController{
public String savePwdByPwdQuestion(User user, HttpServletRequest request) {
String userCode = UserUtils.getCache("fpUserCode");
String loginCode = UserUtils.getCache("fpLoginCode");
// 一同验证保存的用户名和验证码是否正确(如果只校验验证码,不验证用户名,则会有获取验证码后修改用户名的漏洞)
if (!(userCode != null && loginCode != null && loginCode.equals(user.getLoginCode()))){
return renderResult(Global.FALSE, text("请重新获取保密问题!"));
@@ -355,7 +357,7 @@ public class AccountController extends BaseController{
}
// 验证三个密保问题是否正确。
User u = UserUtils.getByLoginCode(user.getLoginCode());
User u = UserUtils.get(userCode);
if (!(u != null && loginCode.equals(user.getLoginCode())
&& PwdUtils.validatePassword(user.getPwdQuestionAnswer(), u.getPwdQuestionAnswer())
&& PwdUtils.validatePassword(user.getPwdQuestionAnswer2(), u.getPwdQuestionAnswer2())
@@ -548,39 +550,39 @@ public class AccountController extends BaseController{
* 发送邮件验证码
*/
private String sendEmailValidCode(User user, String code, String title, Map<String, Object> data){
String account = user.getEmail();
String email = user.getEmail();
try {
title = text("{0}{1}{2}验证码", user.getUserName(), user.getLoginCode(), title);
String content = text("尊敬的用户,您好!\n\n您的验证码是{0}(请勿透露给其他人)\n\n"
+ "请复制后,填写在你的验证码窗口完成验证。\n\n本邮件由系统自动发出请勿回复。\n\n感谢您的使用", code);
// String receiveUserCode = "[CODE]"+account;
// String receiveUserCode = "[CODE]"+email;
// MsgPushUtils.push(MsgPush.TYPE_EMAIL, title, content, null, null, receiveUserCode);
EmailUtils.send(account, title, content);
EmailUtils.send(email, title, content);
} catch (Exception e) {
logger.error(title + "发送邮件错误。", e);
return renderResult(Global.FALSE, text("系统出现了点问题,错误信息:{0}", e.getMessage()));
}
account = account.replaceAll("([\\w\\W]?)([\\w\\W]+)([\\w\\W])(@[\\w\\W]+)", "$1****$3$4");
return renderResult(Global.TRUE, text("验证码已发送到“{0}”邮箱账号,请尽快查收!", account), data);
email = EncodeUtils.emailMask(email);
return renderResult(Global.TRUE, text("验证码已发送到“{0}”邮箱账号,请尽快查收!", email), data);
}
/**
* 发送短信验证码
*/
private String sendSmsValidCode(User user, String code, String title, Map<String, Object> data){
String account = user.getMobile();
String mobile = user.getMobile();
try {
title = text("{0}{1}{2}验证码", user.getUserName(), user.getLoginCode(), title);
String content = text("您好,您的验证码是:{0}(请勿透露给其他人)感谢您的使用。", code);
// String receiveUserCode = "[CODE]"+account;
// String receiveUserCode = "[CODE]"+mobile;
// MsgPushUtils.push(MsgPush.TYPE_SMS, title, content, null, null, receiveUserCode);
SmsUtils.send(content, account);
SmsUtils.send(content, mobile);
} catch (Exception e) {
logger.error(title + "发送短信错误。", e);
return renderResult(Global.FALSE, text("系统出现了点问题,错误信息:{0}", e.getMessage()));
}
account = account.replaceAll("(\\d{3})(\\d+)(\\d{3})","$1****$3");
return renderResult(Global.TRUE, text("验证码已发送到“{0}”的手机号码,请尽快查收!", account), data);
mobile = EncodeUtils.mobileMask(mobile);
return renderResult(Global.TRUE, text("验证码已发送到“{0}”的手机号码,请尽快查收!", mobile), data);
}
}

View File

@@ -49,7 +49,10 @@ public class AreaController extends BaseController {
* 获取区域
*/
@ModelAttribute
public Area get(String areaCode, boolean isNewRecord) {
public Area get(String areaCode, boolean isNewRecord, HttpServletRequest request) {
if (StringUtils.endsWithAny(request.getRequestURI(), "listData", "listPageData")) {
return new Area();
}
return areaService.get(areaCode, isNewRecord);
}
@@ -173,7 +176,7 @@ public class AreaController extends BaseController {
public String disable(Area area) {
Area where = new Area();
where.setStatus(Area.STATUS_NORMAL);
where.setParentCodes("," + area.getId() + ",");
where.setParentCodes_rightLike(area.getParentCodes() + area.getId() + ",");
long count = areaService.findCount(where);
if (count > 0) {
return renderResult(Global.FALSE, text("该区域包含未停用的子区域!"));

View File

@@ -11,8 +11,10 @@ import com.jeesite.common.idgen.IdGen;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.entity.Company;
import com.jeesite.modules.sys.entity.EmpUser;
import com.jeesite.modules.sys.entity.Office;
import com.jeesite.modules.sys.service.CompanyService;
import com.jeesite.modules.sys.service.EmpUserService;
import com.jeesite.modules.sys.service.OfficeService;
import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -43,15 +45,19 @@ public class CompanyController extends BaseController {
@Autowired
private CompanyService companyService;
@Autowired
private OfficeService officeService;
@Autowired
private EmpUserService empUserService;
/**
* 获取公司
*/
@ModelAttribute
public Company get(String companyCode, boolean isNewRecord) {
public Company get(String companyCode, boolean isNewRecord, HttpServletRequest request) {
if (StringUtils.endsWith(request.getRequestURI(), "listData")) {
return new Company();
}
return companyService.get(companyCode, isNewRecord);
}
@@ -89,7 +95,9 @@ public class CompanyController extends BaseController {
if (StringUtils.isBlank(company.getParentCode())) {
company.setParentCode(Company.ROOT_CODE);
}
if (StringUtils.isNotBlank(company.getViewCode())
if (StringUtils.isNotBlank(company.getCompanyCode())
|| StringUtils.isNotBlank(company.getViewCode())
|| StringUtils.isNotBlank(company.getViewCode_like())
|| StringUtils.isNotBlank(company.getCompanyName())
|| StringUtils.isNotBlank(company.getFullName())){
company.setParentCode(null);
@@ -177,7 +185,7 @@ public class CompanyController extends BaseController {
public String disable(Company company) {
Company where = new Company();
where.setStatus(Company.STATUS_NORMAL);
where.setParentCodes("," + company.getId() + ",");
where.setParentCodes_rightLike(company.getParentCodes() + company.getId() + ",");
long count = companyService.findCount(where);
if (count > 0) {
return renderResult(Global.FALSE, text("该公司包含未停用的子公司!"));
@@ -208,6 +216,14 @@ public class CompanyController extends BaseController {
@RequestMapping(value = "delete")
@ResponseBody
public String delete(Company company) {
if (Global.getConfigToBoolean("sys.company.notAllowDeleteIfUserExists", "false")) {
EmpUser empUserWhere = new EmpUser();
empUserWhere.getEmployee().getCompany().setIsQueryChildren(true);
empUserWhere.getEmployee().getCompany().setCompanyCode(company.getCompanyCode());
if (empUserService.findCount(empUserWhere) > 0) {
return renderResult(Global.FALSE, text("不允许删除包含用户的公司"));
}
}
companyService.delete(company);
return renderResult(Global.TRUE, text("删除公司''{0}''成功", company.getCompanyName()));
}

Some files were not shown because too many files have changed in this diff Show More