mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f36bebb19a | |||
| a9c2079c79 | |||
| 50ac6c4977 | |||
| d25915f663 | |||
| c0a95521e4 | |||
| e2af6826b4 | |||
| db4793faad | |||
| dc073c6a4d | |||
| 079b415e80 | |||
| be7744a0da | |||
| 80e26d2b94 | |||
| a2b8777d3d | |||
| a54192ebaf | |||
| 04a8fe7e50 | |||
| 71bbf0f303 | |||
| 94b89f2135 | |||
| d3c139ab5d | |||
| 0e749d830b | |||
| 5158e6e5ec | |||
| 1832b9a636 | |||
| db8bd1e464 | |||
| 372adbd580 | |||
| 0cbdc092d1 | |||
| 55201e82eb | |||
| e4673ecdaa | |||
| 71de6bec63 | |||
| ce704c8e2a | |||
| 64569f8898 | |||
| 8d3e1282a4 | |||
| d5e829bbcf | |||
| f5d4843c55 | |||
| 1b5616282e | |||
| 9e774a457c | |||
| d5ce6a409a | |||
| b972eb1068 | |||
| efd17cdd60 | |||
| 63505e8f6e | |||
| bd4814581a | |||
| c7840a7382 | |||
| c3e049cbd0 | |||
| a6ae4080cb | |||
| 2e90f73da2 | |||
| 85b26230d1 | |||
| fa70a83391 | |||
| bbf85093d5 | |||
| d712776c46 | |||
| 9710b8bc7d | |||
| 3909eb5610 | |||
| cd5fd2f4d4 | |||
| c8a26d73e3 | |||
| e89423c666 | |||
| 67d8cdbc6c | |||
| c14a793906 | |||
| 7f87042e59 | |||
| 4aac17a5e2 | |||
| 5f1d0dafa4 | |||
| 727b67a50d | |||
| dfbbd1bd1f | |||
| 2d9de317c4 | |||
| 56912b766d | |||
| 8baced93a3 | |||
| 0c545517b6 | |||
| a3d6e0ce08 | |||
| 9dcff93372 | |||
| 948e1668b6 | |||
| b17908b581 | |||
| 3bfe099e21 | |||
| 93e755a09c | |||
| 6196f0a463 | |||
| 1481b86fb3 | |||
| eacaa7ed81 | |||
| bc711932f7 | |||
| 44d6f3228f | |||
| dad784228b | |||
| ce02dbbd30 | |||
| d4c2c02602 | |||
| 7935ce86de |
88
README.md
88
README.md
@ -7,24 +7,24 @@
|
||||
JEECG BOOT 低代码开发平台(前后端分离版本)
|
||||
===============
|
||||
|
||||
当前最新版本: 3.1.0(发布日期:2022-03-01)
|
||||
当前最新版本: 3.3.0(发布日期:2022-07-25)
|
||||
|
||||
|
||||
[](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
|
||||
[](http://www.jeecg.com)
|
||||
[](https://jeecg.blog.csdn.net)
|
||||
[](https://github.com/zhangdaiscott/jeecg-boot)
|
||||
[](https://my.oschina.net/jeecg)
|
||||
[](https://github.com/zhangdaiscott/jeecg-boot)
|
||||
[](https://github.com/zhangdaiscott/jeecg-boot)
|
||||
[](https://github.com/zhangdaiscott/jeecg-boot)
|
||||
|
||||
|
||||
|
||||
项目介绍:
|
||||
项目介绍
|
||||
-----------------------------------
|
||||
|
||||
<h3 align="center">Java Low Code Platform for Enterprise web applications</h3>
|
||||
|
||||
JeecgBoot 是一款基于代码生成器的`低代码平台`!前后端分离架构 SpringBoot2.x,SpringCloud,Ant Design&Vue,Mybatis-plus,Shiro,JWT,支持微服务。强大的代码生成器让前后端代码一键生成,实现低代码开发! JeecgBoot 引领新的低代码开发模式(OnlineCoding-> 代码生成器-> 手工MERGE), 帮助解决Java项目70%的重复工作,让开发更多关注业务。既能快速提高效率,节省研发成本,同时又不失灵活性!
|
||||
JeecgBoot 是一款基于代码生成器的`低代码开发平台`!前后端分离架构 SpringBoot2.x,SpringCloud,Ant Design&Vue,Mybatis-plus,Shiro,JWT,支持微服务。强大的代码生成器让前后端代码一键生成,实现低代码开发! JeecgBoot 引领新的低代码开发模式(OnlineCoding-> 代码生成器-> 手工MERGE), 帮助解决Java项目70%的重复工作,让开发更多关注业务。既能快速提高效率,节省研发成本,同时又不失灵活性!
|
||||
|
||||
JeecgBoot 提供了一系列`低代码模块`,实现在线开发`真正的零代码`:Online表单开发、Online报表、报表配置能力、在线图表设计、大屏设计、移动配置能力、表单设计器、在线设计流程、流程自动化配置、插件能力(可插拔)等等!
|
||||
|
||||
@ -34,6 +34,23 @@ JeecgBoot 提供了一系列`低代码模块`,实现在线开发`真正的零
|
||||
`JEECG业务流程:` 采用工作流来实现、扩展出任务接口,供开发编写业务逻辑,表单提供多种解决方案: 表单设计器、online配置表单、编码表单。同时实现了流程与表单的分离设计(松耦合)、并支持任务节点灵活配置,既保证了公司流程的保密性,又减少了开发人员的工作量。
|
||||
|
||||
|
||||
项目源码
|
||||
-----------------------------------
|
||||
| 仓库 |前端源码Vue3版 | 前端源码Vue2版 | 后端源码 |
|
||||
|-|-|-|-|
|
||||
| Github | [jeecgboot-vue3](https://github.com/jeecgboot/jeecgboot-vue3) | [ant-design-vue-jeecg](https://github.com/jeecgboot/jeecg-boot/tree/master/ant-design-vue-jeecg) | [jeecg-boot](https://github.com/jeecgboot/jeecg-boot) |
|
||||
| 码云 | [jeecgboot-vue3](https://gitee.com/jeecg/jeecgboot-vue3) | [ant-design-vue-jeecg](https://gitee.com/jeecg/jeecg-boot/tree/master/ant-design-vue-jeecg) | [jeecg-boot](https://gitee.com/jeecg/jeecg-boot) |
|
||||
|
||||
|
||||
##### 项目说明
|
||||
|
||||
| 项目名 | 说明 |
|
||||
|--------------------|------------------------|
|
||||
| `jeecg-boot` | SpringBoot后台源码(支持微服务) |
|
||||
| `ant-design-vue-jeecg` |Vue2版前端源码(与主项目一起) |
|
||||
| `jeecgboot-vue3` | Vue3版前端源码 |
|
||||
|
||||
|
||||
适用项目
|
||||
-----------------------------------
|
||||
Jeecg-Boot低代码开发平台,可以应用在任何J2EE项目的开发中,尤其适合SAAS项目、企业信息管理系统(MIS)、内部办公系统(OA)、企业资源计划系统(ERP)、客户关系管理系统(CRM)等,其半智能手工Merge的开发方式,可以显著提高开发效率70%以上,极大降低开发成本。
|
||||
@ -45,24 +62,23 @@ Jeecg-Boot低代码开发平台,可以应用在任何J2EE项目的开发中,
|
||||
|
||||
- 技术官网: [http://www.jeecg.com](http://www.jeecg.com)
|
||||
|
||||
- 在线演示 : [http://boot.jeecg.com](http://boot.jeecg.com)
|
||||
- 在线演示 : [Vue2版本](http://boot.jeecg.com) | [Vue3版本](http://boot3.jeecg.com)
|
||||
|
||||
- 开发文档: [http://doc.jeecg.com](http://doc.jeecg.com/2043874)
|
||||
- 开发文档: [主项目文档](http://doc.jeecg.com) | [Vue3文档](http://vue3.jeecg.com)
|
||||
|
||||
- 新手指南: [快速入门](http://www.jeecg.com/doc/quickstart) | [常见问题 ](http://www.jeecg.com/doc/qa) | [入门视频](https://www.bilibili.com/video/BV1Y541147m1) | [技术支持](http://jeecg.com/doc/help) | [1分钟体验低代码](https://my.oschina.net/jeecg/blog/3083313)
|
||||
- 新手指南: [快速入门](http://www.jeecg.com/doc/quickstart) | [视频教程](https://space.bilibili.com/454617261/channel/series) | [常见问题 ](http://www.jeecg.com/doc/qa) | [技术支持](http://jeecg.com/doc/help) | [1分钟体验低代码](https://my.oschina.net/jeecg/blog/3083313)
|
||||
|
||||
- 微服务开发: [单体切换为微服务](http://doc.jeecg.com/2043906)
|
||||
- 微服务开发: [单体切换为微服务](http://doc.jeecg.com/2704725)
|
||||
|
||||
- QQ交流群 : ⑤860162132、683903138(VUE3版)、~~④774126647(满)、③816531124(满)、②769925425(满)、①284271917(满)~~
|
||||
- QQ交流群 : ⑥730954414、VUE3群683903138、⑤860162132(满)、④774126647(满)、③816531124(满)、②769925425(满)、①284271917(满)
|
||||
> ` 提醒:【QQ群是自助服务群,建议给帮助您解决问题的同学发送指定红包,表示感谢!】 `
|
||||
|
||||
Vue3版前端(Beta版)
|
||||
|
||||
Docker启动项目
|
||||
-----------------------------------
|
||||
|
||||
> 采用Vue3.0、Vite、 Ant-Design-Vue、TypeScript 等新技术方案,包括二次封装组件、utils、hooks、动态菜单、权限校验、按钮级别权限控制等功能! 是在 Vben-Admin 基础上研发的,适合于JeecgBoot的新版前端VUE3框架。
|
||||
|
||||
- 源码下载:https://github.com/jeecgboot/jeecgboot-vue3
|
||||
- 入门指南: [开发文档](http://vue3.jeecg.com/2398845) | [ VUE3版演示 ](http://boot3.jeecg.com) | [入门视频](https://www.bilibili.com/video/BV1V34y187Y9)
|
||||
|
||||
- [Docker镜像单体启动项目](http://doc.jeecg.com/2043889)
|
||||
- [Docker镜像微服务启动项目](http://doc.jeecg.com/2656147)
|
||||
- [jeecgboot-vue3Docker启动](http://vue3.jeecg.com/3028878)
|
||||
|
||||
为什么选择JEECG-BOOT?
|
||||
-----------------------------------
|
||||
@ -115,28 +131,28 @@ Vue3版前端(Beta版)
|
||||
-----------------------------------
|
||||
#### 开发环境
|
||||
|
||||
- 语言:Java 8+ (小于11)
|
||||
- 语言:Java 8+ (小于17)
|
||||
|
||||
- IDE(JAVA): IDEA (必须安装lombok插件 )
|
||||
|
||||
- IDE(前端): IDEA 或者 WebStorm
|
||||
- IDE(前端): Vscode、WebStorm、IDEA
|
||||
|
||||
- 依赖管理:Maven
|
||||
|
||||
- 缓存:Redis
|
||||
|
||||
- 数据库脚本:MySQL5.7+ & Oracle 11g & Sqlserver2017(默认只提供三个库脚本,其他库需要自己转)
|
||||
- 数据库脚本:MySQL5.7+ & Oracle 11g & Sqlserver2017(其他数据库,[需要自己转](https://my.oschina.net/jeecg/blog/4905722))
|
||||
|
||||
|
||||
#### 后端
|
||||
|
||||
- 基础框架:Spring Boot 2.3.5.RELEASE
|
||||
- 基础框架:Spring Boot 2.6.6
|
||||
|
||||
- 微服务框架: Spring Cloud Alibaba 2.2.3.RELEASE
|
||||
- 微服务框架: Spring Cloud Alibaba 2021.1
|
||||
|
||||
- 持久层框架:MybatisPlus 3.4.3.1
|
||||
- 持久层框架:MybatisPlus 3.5.1
|
||||
|
||||
- 报表工具: JimuReport 1.4.32
|
||||
- 报表工具: JimuReport 1.5.0-beta
|
||||
|
||||
- 安全框架:Apache Shiro 1.8.0,Jwt 3.11.0
|
||||
|
||||
@ -151,6 +167,8 @@ Vue3版前端(Beta版)
|
||||
|
||||
#### 前端
|
||||
|
||||
> 此处是Vue2的技术栈介绍,[Vue3版技术栈看这里](https://github.com/jeecgboot/jeecgboot-vue3)
|
||||
|
||||
- [Vue 2.6.10](https://cn.vuejs.org/),[Vuex](https://vuex.vuejs.org/zh/),[Vue Router](https://router.vuejs.org/zh/)
|
||||
- [Axios](https://github.com/axios/axios)
|
||||
- [ant-design-vue](https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn/)
|
||||
@ -190,7 +208,7 @@ Vue3版前端(Beta版)
|
||||
|
||||
4、分布式 http feign √
|
||||
|
||||
5、熔断和降级 Sentinel √
|
||||
5、熔断降级限流 Sentinel √
|
||||
|
||||
6、分布式文件 Minio、阿里OSS √
|
||||
|
||||
@ -216,7 +234,7 @@ Vue3版前端(Beta版)
|
||||
|
||||
|
||||
#### 微服务架构图
|
||||

|
||||

|
||||
|
||||
### Jeecg Boot 产品功能蓝图
|
||||

|
||||
@ -336,18 +354,20 @@ Vue3版前端(Beta版)
|
||||
│ ├─Online在线表单 - 功能已开放
|
||||
│ ├─Online代码生成器 - 功能已开放
|
||||
│ ├─Online在线报表 - 功能已开放
|
||||
│ ├─Online在线图表(暂不开源)
|
||||
│ ├─Online图表模板配置(暂不开源)
|
||||
│ ├─Online布局设计(暂不开源)
|
||||
│ ├─Online在线图表(未开源)
|
||||
│ ├─Online图表模板配置(未开源)
|
||||
│ ├─Online布局设计(未开源)
|
||||
│ ├─多数据源管理 - 功能已开放
|
||||
├─积木报表设计器(低代码)
|
||||
│ ├─打印设计器
|
||||
│ ├─数据报表设计
|
||||
│ ├─图形报表设计(支持echart)
|
||||
│ ├─大屏设计器(暂不开源)
|
||||
│─流程模块功能 (暂不开源)
|
||||
│ ├─大屏设计器(未开源)
|
||||
│─流程模块功能 (未开源)
|
||||
│ ├─流程设计器
|
||||
│ ├─在线表单设计
|
||||
│ ├─表单设计器
|
||||
├─大屏设计器
|
||||
├─门户设计/仪表盘设计器
|
||||
│ └─我的任务
|
||||
│ └─历史流程
|
||||
│ └─历史流程
|
||||
@ -358,10 +378,10 @@ Vue3版前端(Beta版)
|
||||
│ └─我的抄送
|
||||
│ └─流程委派、抄送、跳转
|
||||
│ └─。。。
|
||||
│─OA办公组件 (暂不开源)
|
||||
│─OA办公组件 (未开源)
|
||||
│ ├─更多功能
|
||||
│ └─。。。
|
||||
└─其他模块 (暂不开源)
|
||||
└─其他模块
|
||||
└─更多功能开发中。。
|
||||
|
||||
```
|
||||
|
||||
@ -1,21 +1,213 @@
|
||||
MIT License
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
Copyright (c) 2019 DaiHao Zhang
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
1. Definitions.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (c) 2019 <a href="http://www.jeecg.com">Jeecg Boot</a> All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
In any case, you must not make any such use of this software as to develop software which may be considered competitive with this software.
|
||||
|
||||
开源协议补充
|
||||
JeecgBoot 是由 北京国炬信息技术有限公司 发行的软件。 总部位于北京,地址:中国·北京·朝阳区科荟前街1号院奥林佳泰大厦。邮箱:jeecgos@163.com
|
||||
本软件受适用的国家软件著作权法(包括国际条约)和双重保护许可。
|
||||
|
||||
1.允许基于本平台软件开展业务系统开发。
|
||||
2.不得基于该平台软件的基础,修改包装成一个与JeecgBoot平台软件功能类似的产品进行发布、销售,或与JeecgBoot参与同类软件产品市场的竞争。
|
||||
违反此条款属于侵权行为,须赔偿侵权经济损失,同时立即停止著作权侵权行为。
|
||||
解释权归:http://www.jeecg.com
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@ -1,7 +1,7 @@
|
||||
Ant Design Jeecg Vue
|
||||
====
|
||||
|
||||
当前最新版本: 3.1.0(发布日期:20220301)
|
||||
当前最新版本: 3.3.0(发布日期:20220725)
|
||||
|
||||
Overview
|
||||
----
|
||||
@ -56,6 +56,31 @@ yarn run build
|
||||
yarn run lint
|
||||
```
|
||||
|
||||
Docker镜像启动前端(单体模式)
|
||||
----
|
||||
|
||||
```
|
||||
# 1.配置host
|
||||
|
||||
127.0.0.1 jeecg-boot-system
|
||||
|
||||
# 2.修改前端项目的后台域名
|
||||
.env.development
|
||||
域名改成: http://jeecg-boot-system:8080/jeecg-boot
|
||||
|
||||
# 3.进入项目根目录,执行打包命令
|
||||
yarn run build
|
||||
|
||||
# 4.构建镜像
|
||||
docker build -t jeecgboot-ui2 .
|
||||
|
||||
# 5.启动镜像
|
||||
docker run --name jeecgboot-ui-vue2 -p 80:80 -d jeecgboot-ui2
|
||||
|
||||
# 6.访问前台项目
|
||||
http://localhost
|
||||
```
|
||||
|
||||
|
||||
|
||||
其他说明
|
||||
@ -106,30 +131,3 @@ yarn run lint
|
||||
> @vue/cli 升级后,eslint 规则更新了。由于影响到全部 .vue 文件,需要逐个验证。既暂时关闭部分原本不验证的规则,后期维护时,在逐步修正这些 rules
|
||||
|
||||
|
||||
Docker 镜像使用
|
||||
----
|
||||
|
||||
```
|
||||
# 1.修改前端项目的后台域名
|
||||
.env.development
|
||||
域名改成: http://jeecg-boot-system:8080/jeecg-boot
|
||||
|
||||
# 2.先进入打包前端项目
|
||||
yarn run build
|
||||
|
||||
# 3.构建镜像
|
||||
docker build -t nginx:jeecgboot .
|
||||
|
||||
# 4.启动镜像
|
||||
docker run --name jeecg-boot-nginx -p 80:80 -d nginx:jeecgboot
|
||||
|
||||
# 5.配置host
|
||||
|
||||
# jeecgboot
|
||||
127.0.0.1 jeecg-boot-redis
|
||||
127.0.0.1 jeecg-boot-mysql
|
||||
127.0.0.1 jeecg-boot-system
|
||||
|
||||
# 6.访问前台项目
|
||||
http://localhost:80
|
||||
```
|
||||
@ -10,8 +10,8 @@
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"ant-design-vue": "^1.7.2",
|
||||
"@jeecg/antd-online-mini": "3.1.0-beta",
|
||||
"ant-design-vue": "^1.7.2",
|
||||
"@antv/data-set": "^0.11.4",
|
||||
"viser-vue": "^2.4.8",
|
||||
"axios": "^0.18.0",
|
||||
@ -29,7 +29,7 @@
|
||||
"vue-ls": "^3.2.0",
|
||||
"vue-router": "^3.0.1",
|
||||
"vuex": "^3.1.0",
|
||||
"vue-print-nb-jeecg": "^1.0.9",
|
||||
"vue-print-nb-jeecg": "^1.0.11",
|
||||
"clipboard": "^2.0.4",
|
||||
"vue-photo-preview": "^1.1.3",
|
||||
"vue-splitpane": "^1.0.4",
|
||||
@ -45,7 +45,8 @@
|
||||
"vxe-table": "2.9.13",
|
||||
"vxe-table-plugin-antd": "1.8.10",
|
||||
"cron-parser": "^2.10.0",
|
||||
"qiankun": "^2.5.1"
|
||||
"qiankun": "^2.5.1",
|
||||
"xss": "^1.0.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/polyfill": "^7.2.5",
|
||||
|
||||
@ -69,7 +69,6 @@ export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItem
|
||||
function getDictItemsFromCache(dictCode) {
|
||||
if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]) {
|
||||
let dictItems = Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode];
|
||||
//console.log("-----------getDictItemsFromCache----------dictCode="+dictCode+"---- dictItems=",dictItems)
|
||||
return dictItems;
|
||||
}
|
||||
}
|
||||
@ -91,6 +90,7 @@ const loadCategoryData = (params)=>getAction("/sys/category/loadAllData",params)
|
||||
const checkRuleByCode = (params) => getAction('/sys/checkRule/checkByCode', params)
|
||||
//加载我的通告信息
|
||||
const getUserNoticeInfo= (params)=>getAction("/sys/sysAnnouncementSend/getMyAnnouncementSend",params);
|
||||
//查询图表数据
|
||||
const getTransitURL = url => `/sys/common/transitRESTful?url=${encodeURIComponent(url)}`
|
||||
// 中转HTTP请求
|
||||
export const transitRESTful = {
|
||||
@ -101,8 +101,6 @@ export const transitRESTful = {
|
||||
}
|
||||
|
||||
export {
|
||||
// imgView,
|
||||
// doMian,
|
||||
addRole,
|
||||
editRole,
|
||||
checkRoleCode,
|
||||
|
||||
@ -16,7 +16,9 @@ export default api
|
||||
export function postAction(url,parameter) {
|
||||
let sign = signMd5Utils.getSign(url, parameter);
|
||||
//将签名和时间戳,添加在请求接口 Header
|
||||
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
|
||||
// update-begin--author:taoyan---date:20220421--for: VUEN-410【签名改造】 X-TIMESTAMP牵扯
|
||||
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getTimestamp()};
|
||||
// update-end--author:taoyan---date:20220421--for: VUEN-410【签名改造】 X-TIMESTAMP牵扯
|
||||
|
||||
return axios({
|
||||
url: url,
|
||||
@ -30,7 +32,9 @@ export function postAction(url,parameter) {
|
||||
export function httpAction(url,parameter,method) {
|
||||
let sign = signMd5Utils.getSign(url, parameter);
|
||||
//将签名和时间戳,添加在请求接口 Header
|
||||
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
|
||||
// update-begin--author:taoyan---date:20220421--for: VUEN-410【签名改造】 X-TIMESTAMP牵扯
|
||||
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getTimestamp()};
|
||||
// update-end--author:taoyan---date:20220421--for: VUEN-410【签名改造】 X-TIMESTAMP牵扯
|
||||
|
||||
return axios({
|
||||
url: url,
|
||||
@ -53,7 +57,9 @@ export function putAction(url,parameter) {
|
||||
export function getAction(url,parameter) {
|
||||
let sign = signMd5Utils.getSign(url, parameter);
|
||||
//将签名和时间戳,添加在请求接口 Header
|
||||
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getDateTimeToString()};
|
||||
// update-begin--author:taoyan---date:20220421--for: VUEN-410【签名改造】 X-TIMESTAMP牵扯
|
||||
let signHeader = {"X-Sign": sign,"X-TIMESTAMP": signMd5Utils.getTimestamp()};
|
||||
// update-end--author:taoyan---date:20220421--for: VUEN-410【签名改造】 X-TIMESTAMP牵扯
|
||||
|
||||
return axios({
|
||||
url: url,
|
||||
@ -120,13 +126,23 @@ export function saveService(parameter) {
|
||||
* @param parameter
|
||||
* @returns {*}
|
||||
*/
|
||||
export function downFile(url,parameter){
|
||||
export function downFile(url,parameter, method='get'){
|
||||
if(method=='get'){
|
||||
return axios({
|
||||
url: url,
|
||||
params: parameter,
|
||||
method:'get' ,
|
||||
method: method ,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}else{
|
||||
return axios({
|
||||
url: url,
|
||||
method: method,
|
||||
data: parameter,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -387,7 +387,7 @@
|
||||
<a-menu-item v-if="col.allowDownload!==false" @click="handleClickDownloadFile(id)">
|
||||
<span><a-icon type="download"/> 下载</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item v-if="col.allowRemove!==false" @click="handleClickDelFile(id)">
|
||||
<a-menu-item v-if="col.allowRemove!==false" @click="handleClickDelFile(id, row, col)">
|
||||
<span><a-icon type="delete"/> 删除</span>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
@ -475,7 +475,7 @@
|
||||
<a-menu-item v-if="col.allowDownload!==false" @click="handleClickDownFileByUrl(id)">
|
||||
<span><a-icon type="download"/> 下载</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="handleClickDelFile(id)">
|
||||
<a-menu-item @click="handleClickDelFile(id, row, col)">
|
||||
<span><a-icon type="delete"/> 删除</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="handleMoreOperation(id,col,col)">
|
||||
@ -532,7 +532,7 @@
|
||||
<a-menu-item v-if="col.allowDownload!==false" @click="handleClickDownFileByUrl(id)">
|
||||
<span><a-icon type="download"/> 下载</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="handleClickDelFile(id)">
|
||||
<a-menu-item @click="handleClickDelFile(id, row, col)">
|
||||
<span><a-icon type="delete"/> 删除</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="handleMoreOperation(id,'img',col)">
|
||||
@ -1865,6 +1865,8 @@
|
||||
})
|
||||
// 强制更新formValues
|
||||
this.forceUpdateFormValues()
|
||||
// 【issues/3828】重新计算统计列
|
||||
this.recalcAllStatisticsColumns()
|
||||
},
|
||||
/**
|
||||
* 设置单个组件的值
|
||||
@ -2590,8 +2592,9 @@
|
||||
return id;
|
||||
},
|
||||
|
||||
handleClickDelFile(id) {
|
||||
handleClickDelFile(id, row, col) {
|
||||
this.uploadValues[id] = null
|
||||
this.elemValueChange(col.type, row, col, null);
|
||||
},
|
||||
handleClickDownloadFile(id) {
|
||||
let { path } = this.uploadValues[id] || {}
|
||||
@ -3074,7 +3077,11 @@
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
// 根据id获取dataSource中的一行数据
|
||||
getOriginData(id){
|
||||
return this.dataSource.filter(item=>item.id == id);
|
||||
},
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
@ -68,6 +68,9 @@
|
||||
branding: false,
|
||||
menubar: false,
|
||||
toolbar_drawer: false,
|
||||
//update-begin-author:taoyan date:2022-5-6 for: issues/I4BCC3 富文本编辑器在服务器图片上传是相对路径
|
||||
convert_urls: false,
|
||||
//update-end-author:taoyan date:2022-5-6 for: issues/I4BCC3 富文本编辑器在服务器图片上传是相对路径
|
||||
images_upload_handler: (blobInfo, success) => {
|
||||
let formData = new FormData()
|
||||
formData.append('file', blobInfo.blob(), blobInfo.filename());
|
||||
|
||||
@ -49,7 +49,8 @@
|
||||
|
||||
.jeecg-form-container-disabled .ant-upload-select{display:none}
|
||||
.jeecg-form-container-disabled .ant-upload-list{cursor:grabbing}
|
||||
.jeecg-form-container-disabled fieldset[disabled] .ant-upload-list{
|
||||
.jeecg-form-container-disabled fieldset[disabled] .ant-upload-list,
|
||||
.jeecg-form-container-disabled fieldset[disabled] iframe{
|
||||
-ms-pointer-events: auto !important;
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
v-on="$listeners"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
destroyOnClose
|
||||
:destroyOnClose="destroyOnClose"
|
||||
>
|
||||
|
||||
<slot></slot>
|
||||
@ -49,13 +49,17 @@
|
||||
|
||||
import { getClass, getStyle } from '@/utils/props-util'
|
||||
import { triggerWindowResizeEvent } from '@/utils/util'
|
||||
import ModalDragMixins from './ModalDragMixins'
|
||||
|
||||
export default {
|
||||
name: 'JModal',
|
||||
mixins: [ModalDragMixins],
|
||||
props: {
|
||||
title: String,
|
||||
// 可使用 .sync 修饰符
|
||||
visible: Boolean,
|
||||
// 是否开启拖拽
|
||||
draggable: Boolean,
|
||||
// 是否全屏弹窗,当全屏时无论如何都会禁止 body 滚动。可使用 .sync 修饰符
|
||||
fullscreen: {
|
||||
type: Boolean,
|
||||
@ -71,6 +75,11 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 关闭时销毁弹窗内容
|
||||
destroyOnClose: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -162,6 +171,16 @@ export default {
|
||||
toggleFullscreen() {
|
||||
this.innerFullscreen = !this.innerFullscreen
|
||||
triggerWindowResizeEvent()
|
||||
// 全屏的时候禁止拖动
|
||||
if (this.innerFullscreen) {
|
||||
// 还原弹窗的位置为0,0
|
||||
this.setModalPosition(0, 0, false)
|
||||
this.dragSettings.headerEl.style.cursor = null
|
||||
} else {
|
||||
// 取消全屏的时候,将弹窗移动到上次记录的位置
|
||||
this.resetModalPosition()
|
||||
this.dragSettings.headerEl.style.cursor = 'move'
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,152 @@
|
||||
import {getRefPromise} from '@/utils/util'
|
||||
|
||||
/** JModal 的拖拽混入 */
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 拖动配置
|
||||
dragSettings: {
|
||||
// 上次拖动top记录
|
||||
top: null,
|
||||
// 上次拖动left记录
|
||||
left: null,
|
||||
wrapEl: null,
|
||||
dragEl: null,
|
||||
headerEl: null,
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible() {
|
||||
if (!this.visible || !this.draggable) {
|
||||
return
|
||||
}
|
||||
this.handleDrag()
|
||||
},
|
||||
draggable() {
|
||||
if (!this.visible || !this.draggable) {
|
||||
return
|
||||
}
|
||||
this.handleDrag()
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async handleDrag() {
|
||||
let modalRef = await getRefPromise(this, 'modal')
|
||||
const dragWraps = modalRef.$el.querySelectorAll('.ant-modal-wrap')
|
||||
let wrapEl = dragWraps[0]
|
||||
if (!wrapEl) return
|
||||
this.dragSettings.wrapEl = wrapEl
|
||||
this.dragSettings.dragEl = wrapEl.querySelector('.ant-modal')
|
||||
this.dragSettings.headerEl = wrapEl.querySelector('.ant-modal-header')
|
||||
const display = getStyle(wrapEl, 'display')
|
||||
const draggable = wrapEl.getAttribute('data-drag')
|
||||
if (display !== 'none') {
|
||||
// 拖拽位置
|
||||
if (draggable === null || this.destroyOnClose) {
|
||||
this.enableDrag(wrapEl)
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 启用拖拽 */
|
||||
enableDrag() {
|
||||
let {wrapEl, dragEl, headerEl} = this.dragSettings
|
||||
if (!wrapEl) return
|
||||
wrapEl.setAttribute('data-drag', this.draggable)
|
||||
if (!headerEl || !dragEl || !this.draggable) return
|
||||
|
||||
// 还原上一次移动的位置
|
||||
this.resetModalPosition()
|
||||
|
||||
headerEl.style.cursor = 'move'
|
||||
headerEl.onmousedown = (e) => {
|
||||
if (!e) return
|
||||
// 鼠标按下,计算当前元素距离可视区的距离
|
||||
const disX = e.clientX
|
||||
const disY = e.clientY
|
||||
const screenWidth = document.body.clientWidth // body当前宽度
|
||||
const screenHeight = document.documentElement.clientHeight // 可见区域高度(应为body高度,可某些环境下无法获取)
|
||||
|
||||
const dragElWidth = dragEl.offsetWidth // 对话框宽度
|
||||
const dragElHeight = dragEl.offsetHeight // 对话框高度
|
||||
|
||||
const minDragElLeft = dragEl.offsetLeft
|
||||
|
||||
const maxDragElLeft = screenWidth - dragEl.offsetLeft - dragElWidth
|
||||
const minDragElTop = dragEl.offsetTop
|
||||
const maxDragElTop = screenHeight - dragEl.offsetTop - dragElHeight
|
||||
// 获取到的值带px 正则匹配替换
|
||||
const domLeft = getStyle(dragEl, 'left')
|
||||
const domTop = getStyle(dragEl, 'top')
|
||||
let styL = +domLeft
|
||||
let styT = +domTop
|
||||
|
||||
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
|
||||
if (domLeft.includes('%')) {
|
||||
styL = +document.body.clientWidth * (+domLeft.replace(/%/g, '') / 100)
|
||||
styT = +document.body.clientHeight * (+domTop.replace(/%/g, '') / 100)
|
||||
} else {
|
||||
styL = +domLeft.replace(/px/g, '')
|
||||
styT = +domTop.replace(/px/g, '')
|
||||
}
|
||||
|
||||
document.onmousemove = (e) => {
|
||||
// 全屏时不触发移动方法
|
||||
if (this.innerFullscreen) {
|
||||
return
|
||||
}
|
||||
// 通过事件委托,计算移动的距离
|
||||
let left = e.clientX - disX
|
||||
let top = e.clientY - disY
|
||||
|
||||
// 边界处理
|
||||
if (-left > minDragElLeft) {
|
||||
left = -minDragElLeft
|
||||
} else if (left > maxDragElLeft) {
|
||||
left = maxDragElLeft
|
||||
}
|
||||
|
||||
if (-top > minDragElTop) {
|
||||
top = -minDragElTop
|
||||
} else if (top > maxDragElTop) {
|
||||
top = maxDragElTop
|
||||
}
|
||||
|
||||
this.setModalPosition(top + styT, left + styL)
|
||||
}
|
||||
|
||||
document.onmouseup = () => {
|
||||
document.onmousemove = null
|
||||
document.onmouseup = null
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 移动弹窗位置
|
||||
* @param top 顶部位置
|
||||
* @param left 左侧位置
|
||||
* @param remember 是否记录位置,默认 true
|
||||
*/
|
||||
setModalPosition(top, left, remember = true) {
|
||||
// 记录移动位置
|
||||
if (remember) {
|
||||
this.dragSettings.top = top
|
||||
this.dragSettings.left = left
|
||||
}
|
||||
// 移动当前元素
|
||||
this.dragSettings.dragEl.style.cssText += `;left:${left}px;top:${top}px;`
|
||||
},
|
||||
/**
|
||||
* 将弹窗移动到上次记录的位置
|
||||
*/
|
||||
resetModalPosition() {
|
||||
this.setModalPosition(this.dragSettings.top, this.dragSettings.left, false)
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
function getStyle(dom, attr) {
|
||||
return getComputedStyle(dom)[attr]
|
||||
}
|
||||
@ -29,6 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
:mask="false"
|
||||
:fullscreen="izMobile"
|
||||
draggable
|
||||
class="j-super-query-modal"
|
||||
style="top:5%;max-height: 95%;"
|
||||
>
|
||||
@ -163,8 +164,10 @@
|
||||
<a-time-picker v-else-if="item.type==='time'" :value="item.val ? moment(item.val,'HH:mm:ss') : null" format="HH:mm:ss" style="width: 100%" @change="(time,value)=>item.val=value"/>
|
||||
<a-input-number v-else-if=" item.type=='int'||item.type=='number' " style="width: 100%" placeholder="请输入数值" v-model="item.val"/>
|
||||
<a-select v-else-if="item.type=='switch'" placeholder="请选择" v-model="item.val">
|
||||
<a-select-option value="Y">是</a-select-option>
|
||||
<a-select-option value="N">否</a-select-option>
|
||||
<!-- update-begin-author:taoyan for: VUEN-242【online表单 高级查询】开关组件设置扩展参数为[0,1] 时,高级查询选择后查询仍然是Y/N -->
|
||||
<a-select-option :value="item.extendOption[0]">是</a-select-option>
|
||||
<a-select-option :value="item.extendOption[1]">否</a-select-option>
|
||||
<!-- update-end-author:taoyan for: VUEN-242【online表单 高级查询】开关组件设置扩展参数为[0,1] 时,高级查询选择后查询仍然是Y/N -->
|
||||
</a-select>
|
||||
<a-input v-else v-model="item.val" placeholder="请输入值"/>
|
||||
</a-col>
|
||||
@ -426,10 +429,17 @@
|
||||
item['dictCode'] = dictCode
|
||||
item['dictTable'] = dictTable
|
||||
item['dictText'] = dictText
|
||||
//update-begin-author:taoyan for: VUEN-242【online表单 高级查询】开关组件设置扩展参数为[0,1] 时,高级查询选择后查询仍然是Y/N
|
||||
item['extendOption'] = node.dataRef.extendOption || ['Y', 'N']
|
||||
//update-begin-author:taoyan for: VUEN-242【online表单 高级查询】开关组件设置扩展参数为[0,1] 时,高级查询选择后查询仍然是Y/N
|
||||
item['customReturnField'] = customReturnField
|
||||
if (popup) {
|
||||
item['popup'] = popup
|
||||
}
|
||||
// 格式化字符串,一般用于高级查询的日期格式处理
|
||||
if (node.dataRef.formatStr) {
|
||||
item['formatStr'] = node.dataRef.formatStr
|
||||
}
|
||||
this.$set(item, 'val', undefined)
|
||||
},
|
||||
handleOpen() {
|
||||
|
||||
@ -71,6 +71,12 @@
|
||||
let className = target.className || ''
|
||||
className = typeof className === 'string' ? className : className.toString()
|
||||
|
||||
// 获取 td 父级
|
||||
let td = getParentNodeByTagName(target, 'td');
|
||||
// 点击的是拖拽排序列,不做处理
|
||||
if (td && td.querySelector('.j-vxe-ds-icons')) {
|
||||
return
|
||||
}
|
||||
// 点击的是expand,不做处理
|
||||
if (className.includes('vxe-table--expand-btn')) {
|
||||
return
|
||||
|
||||
@ -763,6 +763,8 @@ export default {
|
||||
console.warn(`JVxeTable.setValues:必须传递数组`)
|
||||
return
|
||||
}
|
||||
// 是否更新了数据
|
||||
let updated = false
|
||||
values.forEach((item, idx) => {
|
||||
let {rowKey, values: record} = item
|
||||
let {row} = this.getIfRowById(rowKey)
|
||||
@ -775,6 +777,7 @@ export default {
|
||||
let oldValue = row[colKey]
|
||||
let newValue = record[colKey]
|
||||
if (newValue !== oldValue) {
|
||||
updated = true
|
||||
this.$set(row, colKey, newValue)
|
||||
// 触发 valueChange 事件
|
||||
this.trigger('valueChange', {
|
||||
@ -791,6 +794,14 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
// 【issues/3828】数据更新后,重新计算统计列
|
||||
if (updated && this.statistics.has) {
|
||||
this.$nextTick(async () => {
|
||||
let {xTable} = this.$refs.vxe.$refs;
|
||||
await xTable.updateCache(true);
|
||||
await xTable.updateData();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/** 获取所有的数据,包括values、deleteIds */
|
||||
@ -1406,7 +1417,7 @@ const fooPatterns = [
|
||||
{title: '字母', value: 's', pattern: /^[A-Z|a-z]+$/},
|
||||
{title: '数字', value: 'n', pattern: /^-?\d+(\.?\d+|\d?)$/},
|
||||
{title: '整数', value: 'z', pattern: /^-?\d+$/},
|
||||
{title: '金额', value: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/},
|
||||
{title: '金额', value: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,5}))$/},
|
||||
]
|
||||
|
||||
/** 旧版handler转为新版Validator */
|
||||
|
||||
@ -133,6 +133,10 @@
|
||||
value['message'] = file.response.message || '未知错误'
|
||||
}
|
||||
this.innerFile = value
|
||||
// issues/I5FTO6 JVxeTypes.upload 文件上传的时候,触发不了事件
|
||||
if (value.path) {
|
||||
this.handleChangeCommon(fileGetValue(value));
|
||||
}
|
||||
},
|
||||
|
||||
// handleClickPreviewFile(id) {
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import store from '@/store/'
|
||||
import { randomUUID } from '@/utils/util'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
// vxe socket
|
||||
const vs = {
|
||||
// 页面唯一 id,用于标识同一用户,不同页面的websocket
|
||||
@ -52,7 +55,10 @@ const vs = {
|
||||
const domain = window._CONFIG['domianURL'].replace('https://', 'wss://').replace('http://', 'ws://')
|
||||
const url = `${domain}/vxeSocket/${userId}/${this.pageId}`
|
||||
|
||||
this.ws = new WebSocket(url)
|
||||
//update-begin-author:taoyan date:2022-4-22 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
let token = Vue.ls.get(ACCESS_TOKEN)
|
||||
this.ws = new WebSocket(url, [token])
|
||||
//update-end-author:taoyan date:2022-4-22 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
this.ws.onopen = this.on.open.bind(this)
|
||||
this.ws.onerror = this.on.error.bind(this)
|
||||
this.ws.onmessage = this.on.message.bind(this)
|
||||
|
||||
@ -7,12 +7,15 @@
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import { TENANT_ID } from "@/store/mutation-types"
|
||||
import PageLayout from '../page/PageLayout'
|
||||
import RouteView from './RouteView'
|
||||
import {mixinDevice} from '@/utils/mixin'
|
||||
|
||||
export default {
|
||||
name: "IframePageContent",
|
||||
inject:['closeCurrent'],
|
||||
mixins: [mixinDevice],
|
||||
data () {
|
||||
return {
|
||||
url: "",
|
||||
@ -47,10 +50,21 @@
|
||||
} else {
|
||||
this.url = url
|
||||
}
|
||||
|
||||
//update-begin---author:wangshuai ---date:20220711 for:[VUEN-1638]菜单tenantId需要动态生成------------
|
||||
let tenantIdStr = '${tenantId}'
|
||||
let tenantUrl = this.url
|
||||
if (tenantUrl.indexOf(tenantIdStr) != -1) {
|
||||
let tenantId = Vue.ls.get(TENANT_ID)
|
||||
this.url = tenantUrl.replace(tenantIdStr, tenantId)
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20220711 for:[VUEN-1638]菜单tenantId需要动态生成--------------
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
// 是否允许打开外部页面,需要非Mobile模式且打开多页签模式
|
||||
let allowOpen = !this.isMobile() && this.$store.state.app.multipage
|
||||
/*update_begin author:wuxianquan date:20190908 for:判断打开方式,新窗口打开时this.$route.meta.internalOrExternal==true */
|
||||
if(this.$route.meta.internalOrExternal != undefined && this.$route.meta.internalOrExternal==true){
|
||||
if(allowOpen && this.$route.meta.internalOrExternal === true){
|
||||
this.closeCurrent();
|
||||
window.open(this.url);
|
||||
}
|
||||
|
||||
@ -70,7 +70,9 @@
|
||||
/* update_begin author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用 ->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
|
||||
provide(){
|
||||
return{
|
||||
closeCurrent:this.closeCurrent
|
||||
closeCurrent:this.closeCurrent,
|
||||
changeTitle: this.changeTitle,
|
||||
changeTabTitle: this.changeTabTitle,
|
||||
}
|
||||
},
|
||||
/* update_end author:wuxianquan date:20190828 for: 关闭当前tab页,供子页面调用->望菜单能配置外链,直接弹出新页面而不是嵌入iframe #428 */
|
||||
@ -176,6 +178,10 @@
|
||||
// update-end-author:sunjianlei date:20191223 for: 修复从单页模式切换回多页模式后首页不居第一位的 BUG
|
||||
|
||||
// update-begin-author:sunjianlei date:20200120 for: 动态更改页面标题
|
||||
/**
|
||||
* 修改当前页面的窗口标题
|
||||
* @param title 要修改的新标题
|
||||
*/
|
||||
changeTitle(title) {
|
||||
let projectTitle = "Jeecg-Boot 企业级低代码平台"
|
||||
// 首页特殊处理
|
||||
@ -185,6 +191,19 @@
|
||||
document.title = title + ' · ' + projectTitle
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 修改tab标签的标题
|
||||
* @param title 要修改的新标题
|
||||
* @param fullPath 要修改的路由全路径,如果不填就是修改当前路由
|
||||
*/
|
||||
changeTabTitle(title, fullPath = '') {
|
||||
if (title) {
|
||||
let currentRoute = this.pageList.find((r) => r.fullPath === (fullPath ? fullPath : this.$route.fullPath))
|
||||
if (currentRoute != null) {
|
||||
currentRoute.meta = {...currentRoute.meta, title}
|
||||
}
|
||||
}
|
||||
},
|
||||
// update-end-author:sunjianlei date:20200120 for: 动态更改页面标题
|
||||
|
||||
changePage(key) {
|
||||
|
||||
@ -81,7 +81,8 @@
|
||||
import ShowAnnouncement from './ShowAnnouncement'
|
||||
import store from '@/store/'
|
||||
import DynamicNotice from './DynamicNotice'
|
||||
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: "HeaderNotice",
|
||||
@ -107,6 +108,8 @@
|
||||
stopTimer:false,
|
||||
websock: null,
|
||||
lockReconnect:false,
|
||||
//websocket错误连接次数
|
||||
wsConnectErrorTime:1,
|
||||
heartCheck:null,
|
||||
formData:{},
|
||||
openPath:''
|
||||
@ -201,7 +204,10 @@
|
||||
var userId = store.getters.userInfo.id;
|
||||
var url = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://")+"/websocket/"+userId;
|
||||
//console.log(url);
|
||||
this.websock = new WebSocket(url);
|
||||
//update-begin-author:taoyan date:2022-4-22 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
let token = Vue.ls.get(ACCESS_TOKEN)
|
||||
this.websock = new WebSocket(url, [token]);
|
||||
//update-end-author:taoyan date:2022-4-22 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
this.websock.onopen = this.websocketOnopen;
|
||||
this.websock.onerror = this.websocketOnerror;
|
||||
this.websock.onmessage = this.websocketOnmessage;
|
||||
@ -213,12 +219,21 @@
|
||||
//this.heartCheck.reset().start();
|
||||
},
|
||||
websocketOnerror: function (e) {
|
||||
console.log("WebSocket连接发生错误");
|
||||
console.log("WebSocket连接发生错误,第%s次",this.wsConnectErrorTime);
|
||||
|
||||
this.wsConnectErrorTime = this.wsConnectErrorTime + 1;
|
||||
if(this.wsConnectErrorTime>5){
|
||||
console.log("WebSocket连接错误超过5次,就不再重新连了!");
|
||||
this.lockReconnect = true
|
||||
return;
|
||||
}
|
||||
|
||||
this.reconnect();
|
||||
},
|
||||
websocketOnmessage: function (e) {
|
||||
console.log("-----接收消息-------",e.data);
|
||||
var data = eval("(" + e.data + ")"); //解析对象
|
||||
this.voiceBroadcast(data.msgTxt)
|
||||
if(data.cmd == "topic"){
|
||||
//系统通知
|
||||
this.loadData();
|
||||
@ -243,7 +258,13 @@
|
||||
console.log("send failed (" + err.code + ")");
|
||||
}
|
||||
},
|
||||
|
||||
//语音播报系统通知
|
||||
voiceBroadcast(text){
|
||||
var url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=" + encodeURI(text); // baidu文字转语音
|
||||
var voiceContent = new Audio(url);
|
||||
voiceContent.src = url;
|
||||
voiceContent.play();
|
||||
},
|
||||
openNotification (data) {
|
||||
var text = data.msgTxt;
|
||||
const key = `open${Date.now()}`;
|
||||
@ -275,7 +296,7 @@
|
||||
console.info("尝试重连...");
|
||||
that.initWebSocket();
|
||||
that.lockReconnect = false;
|
||||
}, 5000);
|
||||
}, 20000);
|
||||
},
|
||||
heartCheckFun(){
|
||||
var that = this;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import xss from "xss"
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
@ -24,6 +25,7 @@
|
||||
|
||||
<script>
|
||||
import {getUserList} from '@/api/api'
|
||||
import xss from 'xss'
|
||||
export default {
|
||||
name: "SysAnnouncementModal",
|
||||
components: {
|
||||
@ -70,6 +72,11 @@
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20220107 for:将其它页面传递过来的用户名改成用户真实姓名
|
||||
this.visible = true;
|
||||
//update-begin-author:taoyan date:2022-7-14 for: VUEN-1702 【禁止问题】sql注入漏洞
|
||||
if(record.msgContent){
|
||||
record.msgContent = xss(record.msgContent)
|
||||
}
|
||||
//update-end-author:taoyan date:2022-7-14 for: VUEN-1702 【禁止问题】sql注入漏洞
|
||||
this.record = record;
|
||||
},
|
||||
handleCancel () {
|
||||
|
||||
@ -23,7 +23,9 @@ export const WebsocketMixin = {
|
||||
this.socketUrl = this.socketUrl + '/'
|
||||
}
|
||||
var url = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://") + this.socketUrl + userId + "/" + token;
|
||||
this.websock = new WebSocket(url);
|
||||
//update-begin-author:taoyan date:2022-4-22 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
this.websock = new WebSocket(url, [token]);
|
||||
//update-end-author:taoyan date:2022-4-22 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
this.websock.onopen = this.websocketOnopen;
|
||||
this.websock.onerror = this.websocketOnerror;
|
||||
this.websock.onmessage = this.websocketOnmessage;
|
||||
|
||||
@ -104,23 +104,35 @@ export default class signMd5Utils {
|
||||
return paramStr;
|
||||
};
|
||||
|
||||
static getDateTimeToString() {
|
||||
const date_ = new Date()
|
||||
const year = date_.getFullYear()
|
||||
let month = date_.getMonth() + 1
|
||||
let day = date_.getDate()
|
||||
if (month < 10) month = '0' + month
|
||||
if (day < 10) day = '0' + day
|
||||
let hours = date_.getHours()
|
||||
let mins = date_.getMinutes()
|
||||
let secs = date_.getSeconds()
|
||||
const msecs = date_.getMilliseconds()
|
||||
if (hours < 10) hours = '0' + hours
|
||||
if (mins < 10) mins = '0' + mins
|
||||
if (secs < 10) secs = '0' + secs
|
||||
if (msecs < 10) secs = '0' + msecs
|
||||
return year + '' + month + '' + day + '' + hours + '' + mins + '' + secs
|
||||
/**
|
||||
* 接口签名用 生成header中的时间戳
|
||||
* @returns {number}
|
||||
*/
|
||||
static getTimestamp(){
|
||||
return new Date().getTime()
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取客户端时间(签名参数 X_TIMESTAMP)
|
||||
// * @returns {string}
|
||||
// */
|
||||
// static getDateTimeToString() {
|
||||
// const date_ = new Date()
|
||||
// const year = date_.getFullYear()
|
||||
// let month = date_.getMonth() + 1
|
||||
// let day = date_.getDate()
|
||||
// if (month < 10) month = '0' + month
|
||||
// if (day < 10) day = '0' + day
|
||||
// let hours = date_.getHours()
|
||||
// let mins = date_.getMinutes()
|
||||
// let secs = date_.getSeconds()
|
||||
// const msecs = date_.getMilliseconds()
|
||||
// if (hours < 10) hours = '0' + hours
|
||||
// if (mins < 10) mins = '0' + mins
|
||||
// if (secs < 10) secs = '0' + secs
|
||||
// if (msecs < 10) secs = '0' + msecs
|
||||
// return year + '' + month + '' + day + '' + hours + '' + mins + '' + secs
|
||||
// }
|
||||
// true:数值型的,false:非数值型
|
||||
static myIsNaN(value) {
|
||||
return typeof value === 'number' && !isNaN(value);
|
||||
|
||||
@ -113,6 +113,11 @@ service.interceptors.request.use(config => {
|
||||
const $route = router.currentRoute
|
||||
if ($route && $route.name && $route.name.startsWith('low-app') && $route.params.appId) {
|
||||
config.headers['X-Low-App-ID'] = $route.params.appId
|
||||
// lowApp自定义筛选条件
|
||||
if ($route.params.lowAppFilter) {
|
||||
config.params = {...config.params, ...$route.params.lowAppFilter}
|
||||
delete $route.params.lowAppFilter
|
||||
}
|
||||
}
|
||||
// update-end--author:sunjianlei---date:20200723---for 如果当前在low-app环境,并且携带了appId,就向Header里传递appId
|
||||
|
||||
|
||||
@ -1,10 +1,17 @@
|
||||
const validateMobile = (rule, value, callback) => {
|
||||
let reg = /^1(3|4|5|7|8)\d{9}$/
|
||||
//update-beign-author:taoyan date:20220316 for: VUEN-329【bug】为什么不是失去焦点的时候,触发手机号校验
|
||||
if(!value && value!=='0'){
|
||||
callback()
|
||||
}else{
|
||||
if (!reg.test(value)) {
|
||||
callback('请输入正确手机号')
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
//update-end-author:taoyan date:20220316 for: VUEN-329【bug】为什么不是失去焦点的时候,触发手机号校验
|
||||
|
||||
}
|
||||
const validateEn = (rule, value, callback) => {
|
||||
let reg = /^[_a-zA-Z0-9]+$/
|
||||
@ -24,6 +31,7 @@ export const rules = {
|
||||
message: '请输入手机号',
|
||||
trigger: 'blur'
|
||||
}, { validator: validateMobile, trigger: 'blur' }],
|
||||
mobile2: [{ validator: validateMobile, trigger: 'blur' }],
|
||||
userName: [{
|
||||
required: true, message: '请输入用户名', trigger: 'blur'
|
||||
}, { validator: validateEn }],
|
||||
|
||||
@ -627,3 +627,63 @@ export function aspectAroundFunction(obj, funcName, callback) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 休眠
|
||||
* @param ms 毫秒
|
||||
* @return {Promise<unknown>}
|
||||
*/
|
||||
export function sleep(ms) {
|
||||
return new Promise(function (resolve) {
|
||||
return setTimeout(resolve, ms);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定的 $refs 对象
|
||||
* 有时候可能会遇到组件未挂载到页面中的情况,导致无法获取 $refs 中的某个对象
|
||||
* 这个方法可以等待挂载完成之后再返回 $refs 的对象,避免报错
|
||||
*
|
||||
* 用法示例:let modalRef = getRefPromise(this, 'modal')
|
||||
* @param vm vue实例
|
||||
* @param name 要获取的ref名称
|
||||
* @param noComment $el 标签不能是注释
|
||||
**/
|
||||
export function getRefPromise(vm, name, noComment = true) {
|
||||
return new Promise((resolve) => {
|
||||
(function next() {
|
||||
let ref = vm.$refs[name]
|
||||
if (ref && (noComment && ref.$el.tagName)) {
|
||||
resolve(ref)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (noComment) {
|
||||
vm.$forceUpdate()
|
||||
}
|
||||
next()
|
||||
}, 10)
|
||||
}
|
||||
})()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文件xlsx的mime-type
|
||||
* xls: application/vnd.ms-excel
|
||||
* @type {string}
|
||||
*/
|
||||
export const EXPORT_MIME_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
/**
|
||||
* 导出excel文件后缀
|
||||
* @type {string}
|
||||
*/
|
||||
export const EXPORT_FILE_SUFFIX = ".xlsx";
|
||||
|
||||
/**
|
||||
* 字符串是否为null或null字符串
|
||||
* @param str
|
||||
* @return {boolean}
|
||||
*/
|
||||
export function stringIsNull(str) {
|
||||
return str == null || str === 'null' || str === 'undefined';
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
size="default"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:scroll="{}"
|
||||
>
|
||||
<div
|
||||
slot="expandedRowRender"
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
size="default"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:scroll="{}"
|
||||
>
|
||||
<div
|
||||
slot="expandedRowRender"
|
||||
|
||||
@ -538,6 +538,7 @@
|
||||
superQuery: {
|
||||
fieldList: [
|
||||
{ type: 'input', value: 'name', text: '姓名', },
|
||||
{ type: 'switch', value: 'switch', text: '开关', },
|
||||
{ type: 'select', value: 'sex', text: '性别', dictCode: 'sex' },
|
||||
{ type: 'number', value: 'age', text: '年龄', },
|
||||
{
|
||||
|
||||
@ -251,8 +251,6 @@
|
||||
},
|
||||
delRowCustom (index) {
|
||||
console.log(index)
|
||||
let all = this.orderMainModel
|
||||
all['jeecgOrderCustomerList'].splice(index,1);
|
||||
this.orderMainModel.jeecgOrderCustomerList.splice(index,1);
|
||||
this.$forceUpdate();
|
||||
},
|
||||
@ -263,8 +261,6 @@
|
||||
},
|
||||
delRowTicket (index) {
|
||||
console.log(index)
|
||||
let all = this.orderMainModel
|
||||
all['jeecgOrderTicketList'].splice(index,1);
|
||||
this.orderMainModel.jeecgOrderTicketList.splice(index,1);
|
||||
this.$forceUpdate();
|
||||
},
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<a-form-item label="模板类型">
|
||||
<a-input placeholder="请输入模板类型" v-model="queryParam.templateType"></a-input>
|
||||
<j-dict-select-tag placeholder="请选择模板类型" v-model="queryParam.templateType" dictCode="msgType"></j-dict-select-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
@ -51,7 +51,7 @@
|
||||
@change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel">
|
||||
<a-icon type="delete"/>
|
||||
@ -61,7 +61,7 @@
|
||||
<a-button style="margin-left: 8px"> 批量操作
|
||||
<a-icon type="down"/>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</a-dropdown>-->
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
@ -91,14 +91,21 @@
|
||||
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a @click="handleMyEdit(record)">编辑</a>
|
||||
|
||||
<a-divider type="vertical"/>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a @click="handleUse(record)">应用</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a @click="handleNotUse(record)">停用</a>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
@ -125,6 +132,10 @@
|
||||
import SysMessageTestModal from './modules/SysMessageTestModal'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||
import {httpAction} from '@/api/manage'
|
||||
import { deleteAction } from '@/api/manage'
|
||||
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
|
||||
|
||||
|
||||
export default {
|
||||
name: "SysMessageTemplateList",
|
||||
@ -132,7 +143,8 @@
|
||||
components: {
|
||||
JEllipsis,
|
||||
SysMessageTemplateModal,
|
||||
SysMessageTestModal
|
||||
SysMessageTestModal,
|
||||
JDictSelectTag
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -171,16 +183,22 @@
|
||||
dataIndex: 'templateType',
|
||||
customRender: function (text) {
|
||||
if(text=='1') {
|
||||
return "短信";
|
||||
return "文本";
|
||||
}
|
||||
if(text=='2') {
|
||||
return "邮件";
|
||||
return "富文本";
|
||||
}
|
||||
if(text=='3') {
|
||||
return "微信";
|
||||
}
|
||||
if(text=='4') {
|
||||
return "系统";
|
||||
},
|
||||
{
|
||||
title: '是否应用',
|
||||
align: "center",
|
||||
dataIndex: 'useStatus',
|
||||
customRender: function (text) {
|
||||
if(text=='1') {
|
||||
return "是";
|
||||
}else{
|
||||
return '否'
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -209,7 +227,59 @@
|
||||
handleTest(record){
|
||||
this.$refs.testModal.open(record);
|
||||
this.$refs.testModal.title = "发送测试";
|
||||
},
|
||||
//update-begin-author:taoyan date:2022-7-8 for: 修改应用状态
|
||||
updateUseStatus(record, useStatus){
|
||||
let formData = {
|
||||
id: record.id, useStatus: useStatus
|
||||
}
|
||||
httpAction("/sys/message/sysMessageTemplate/edit", formData, 'put').then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message);
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loadData()
|
||||
})
|
||||
},
|
||||
handleUse(record){
|
||||
this.updateUseStatus(record, '1')
|
||||
},
|
||||
handleNotUse(record){
|
||||
this.updateUseStatus(record, '0')
|
||||
},
|
||||
handleMyEdit(record){
|
||||
if(record.useStatus == '1'){
|
||||
this.$message.warning('此模板已被应用,禁止编辑!');
|
||||
}else{
|
||||
this.handleEdit(record);
|
||||
}
|
||||
},
|
||||
//update-end-author:taoyan date:2022-7-8 for: 修改应用状态
|
||||
|
||||
handleDelete: function (record) {
|
||||
if(!this.url.delete){
|
||||
this.$message.error("请设置url.delete属性!")
|
||||
return
|
||||
}
|
||||
if(record.useStatus=='1'){
|
||||
this.$message.error("该模板已被应用禁止删除!")
|
||||
return
|
||||
}
|
||||
let id = record.id;
|
||||
var that = this;
|
||||
deleteAction(that.url.delete, {id: id}).then((res) => {
|
||||
if (res.success) {
|
||||
//重新计算分页问题
|
||||
that.reCalculatePage(1)
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,6 +50,17 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24" >
|
||||
<a-col :span="24" pull="2">
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="是否应用"
|
||||
style="margin-left: -15px">
|
||||
<j-switch v-decorator="['useStatus', validatorRules.useStatus]" :options="['1', '0']"></j-switch>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :span="24" pull="4">
|
||||
<a-form-item
|
||||
@ -85,11 +96,13 @@
|
||||
import pick from 'lodash.pick'
|
||||
import { duplicateCheck } from '@/api/api'
|
||||
import JEditor from '@/components/jeecg/JEditor'
|
||||
import JSwitch from '@/components/jeecg/JSwitch'
|
||||
|
||||
export default {
|
||||
name: "SysMessageTemplateModal",
|
||||
components:{
|
||||
JEditor
|
||||
JEditor,
|
||||
JSwitch
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -111,6 +124,7 @@
|
||||
templateCode: {rules: [{required: true, message: '请输入模板CODE!' },{validator: this.validateTemplateCode}]},
|
||||
templateName: {rules: [{required: true, message: '请输入模板标题!'}]},
|
||||
templateContent: {rules: []},
|
||||
useStatus:{rules: []},
|
||||
templateType: {rules: [{required: true, message: '请输入模板类型!'}]},
|
||||
},
|
||||
url: {
|
||||
@ -140,9 +154,9 @@
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.useEditor){
|
||||
this.form.setFieldsValue(pick(this.model, 'templateCode', 'templateName', 'templateTestJson', 'templateType'))
|
||||
this.form.setFieldsValue(pick(this.model, 'useStatus', 'templateCode', 'templateName', 'templateTestJson', 'templateType'))
|
||||
}else{
|
||||
this.form.setFieldsValue(pick(this.model, 'templateCode', 'templateContent', 'templateName', 'templateTestJson', 'templateType'))
|
||||
this.form.setFieldsValue(pick(this.model, 'useStatus', 'templateCode', 'templateContent', 'templateName', 'templateTestJson', 'templateType'))
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@ -34,14 +34,15 @@
|
||||
label="消息类型">
|
||||
<j-dict-select-tag
|
||||
v-model="msgType"
|
||||
type="radio"
|
||||
placeholder="请选择消息类型"
|
||||
dictCode="msgType"/>
|
||||
dictCode="messageType"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="消息接收方">
|
||||
<a-input placeholder="请输入消息接收方" v-model="receiver"/>
|
||||
<j-select-user-by-dep placeholder="请选择消息接收方" v-model="receiver"></j-select-user-by-dep>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
@ -50,9 +51,13 @@
|
||||
|
||||
<script>
|
||||
import {httpAction} from '@/api/manage'
|
||||
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
||||
|
||||
export default {
|
||||
name: "SysMessageTestModal",
|
||||
components:{
|
||||
JSelectUserByDep
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "操作",
|
||||
@ -74,7 +79,7 @@
|
||||
templateName: "",
|
||||
templateContent: "",
|
||||
receiver: "",
|
||||
msgType: "",
|
||||
msgType: "system",
|
||||
testData: "",
|
||||
sendParams: {}
|
||||
}
|
||||
@ -89,7 +94,7 @@
|
||||
},
|
||||
close() {
|
||||
this.receiver = "";
|
||||
this.msgType = "";
|
||||
this.msgType = "system";
|
||||
this.sendParams = {};
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
@ -110,10 +110,13 @@
|
||||
</a-radio-group>
|
||||
</template>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="部门负责人">
|
||||
<j-select-multi-user v-model="model.directorUserIds" valueKey="id"></j-select-multi-user>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
|
||||
<a-input-number v-model="model.departOrder" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号">
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号" prop="mobile">
|
||||
<a-input placeholder="请输入手机号" v-model="model.mobile" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="地址">
|
||||
@ -149,6 +152,7 @@
|
||||
import {httpAction, deleteAction} from '@/api/manage'
|
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
||||
import DepartAuthModal from './modules/DepartAuthModal'
|
||||
import Vue from 'vue'
|
||||
// 表头
|
||||
const columns = [
|
||||
{
|
||||
@ -236,7 +240,7 @@
|
||||
departName: [{required: true, message: '请输入机构/部门名称!'}],
|
||||
orgCode: [{required: true, message: '请输入机构编码!'}],
|
||||
orgCategory:[{required: true, message: '请输入机构类型!'}],
|
||||
mobile:[{validator: this.validateMobile}]
|
||||
mobile: Vue.prototype.rules.mobile2
|
||||
},
|
||||
url: {
|
||||
delete: '/sys/sysDepart/delete',
|
||||
@ -246,6 +250,7 @@
|
||||
importExcelUrl: "sys/sysDepart/importExcel",
|
||||
},
|
||||
orgCategoryDisabled:false,
|
||||
oldDirectorUserIds:""
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -394,7 +399,13 @@
|
||||
this.model.parentId = record.parentId
|
||||
this.setValuesToForm(record)
|
||||
this.$refs.departAuth.show(record.id);
|
||||
this.oldDirectorUserIds = record.directorUserIds
|
||||
|
||||
//update-beign-author:taoyan date:20220316 for: VUEN-329【bug】为什么不是失去焦点的时候,触发手机号校验
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.form.validateField('mobile')
|
||||
})
|
||||
//update-end-author:taoyan date:20220316 for: VUEN-329【bug】为什么不是失去焦点的时候,触发手机号校验
|
||||
},
|
||||
// 触发onSelect事件时,为部门树右侧的form表单赋值
|
||||
setValuesToForm(record) {
|
||||
@ -431,6 +442,10 @@
|
||||
return
|
||||
}
|
||||
|
||||
//update-begin---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人
|
||||
this.currSelected.oldDirectorUserIds = this.oldDirectorUserIds
|
||||
//update-end---author:wangshuai ---date:20200308 for:[JTC-119]在部门管理菜单下设置部门负责人
|
||||
|
||||
httpAction(this.url.edit, this.currSelected, 'put').then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success('保存成功!')
|
||||
|
||||
@ -105,6 +105,9 @@
|
||||
</a-radio-group>
|
||||
</template>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="部门负责人">
|
||||
<j-select-multi-user v-model="model.directorUserIds" valueKey="id"></j-select-multi-user>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序" prop="departOrder">
|
||||
<a-input-number v-model="model.departOrder"/>
|
||||
</a-form-model-item>
|
||||
@ -146,6 +149,7 @@
|
||||
import DepartAuthModal from './modules/DepartAuthModal'
|
||||
import { cloneObject } from '@/utils/util'
|
||||
import JThirdAppButton from '@comp/jeecgbiz/thirdApp/JThirdAppButton'
|
||||
import Vue from 'vue'
|
||||
// 表头
|
||||
const columns = [
|
||||
{
|
||||
@ -239,7 +243,7 @@
|
||||
departName: [{required: true, message: '请输入机构/部门名称!'}],
|
||||
orgCode: [{required: true, message: '请输入机构编码!'}],
|
||||
orgCategory: [{required: true, message: '请输入机构类型!'}],
|
||||
mobile: [{validator: this.validateMobile}]
|
||||
mobile: Vue.prototype.rules.mobile2
|
||||
},
|
||||
url: {
|
||||
delete: '/sys/sysDepart/delete',
|
||||
@ -249,6 +253,7 @@
|
||||
importExcelUrl: "sys/sysDepart/importExcel",
|
||||
},
|
||||
orgCategoryDisabled:false,
|
||||
oldDirectorUserIds:"" //旧的负责人id
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -435,7 +440,15 @@
|
||||
this.model.parentId = record.parentId
|
||||
this.setValuesToForm(record)
|
||||
this.$refs.departAuth.show(record.id);
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[JTC-119]在部门管理菜单下设置部门负责人
|
||||
this.oldDirectorUserIds = record.directorUserIds
|
||||
//update-end---author:wangshuai ---date:20220316 for:[JTC-119]在部门管理菜单下设置部门负责人
|
||||
|
||||
//update-beign-author:taoyan date:20220316 for: VUEN-329【bug】为什么不是失去焦点的时候,触发手机号校验
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.form.validateField('mobile')
|
||||
})
|
||||
//update-end-author:taoyan date:20220316 for: VUEN-329【bug】为什么不是失去焦点的时候,触发手机号校验
|
||||
},
|
||||
// 触发onSelect事件时,为部门树右侧的form表单赋值
|
||||
setValuesToForm(record) {
|
||||
@ -478,6 +491,9 @@
|
||||
|
||||
let formData = Object.assign(this.currSelected, this.model)
|
||||
console.log('Received values of form: ', formData)
|
||||
//update-begin---author:wangshuai ---date:20220316 for:[JTC-119]在部门管理菜单下设置部门负责人
|
||||
formData.oldDirectorUserIds = this.oldDirectorUserIds
|
||||
//update-end---author:wangshuai ---date:20220316 for:[JTC-119]在部门管理菜单下设置部门负责人
|
||||
httpAction(this.url.edit, formData, 'put').then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success('保存成功!')
|
||||
@ -598,16 +614,6 @@
|
||||
}
|
||||
},
|
||||
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
|
||||
|
||||
// 验证手机号
|
||||
validateMobile(rule,value,callback){
|
||||
if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)){
|
||||
callback();
|
||||
}else{
|
||||
callback("您的手机号码格式不正确!");
|
||||
}
|
||||
|
||||
},
|
||||
onSyncFinally({isToLocal}) {
|
||||
// 同步到本地时刷新下数据
|
||||
if (isToLocal) {
|
||||
|
||||
@ -63,7 +63,6 @@
|
||||
<a @click="handleOpen(record)">用户</a>
|
||||
<a-divider type="vertical"/>
|
||||
|
||||
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">
|
||||
更多 <a-icon type="down"/>
|
||||
@ -125,7 +124,7 @@
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel2">
|
||||
<a-icon type="delete"/>
|
||||
删除
|
||||
取消关联
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button style="margin-left: 8px"> 批量操作
|
||||
@ -161,8 +160,8 @@
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete2(record.id)">
|
||||
<a>删除</a>
|
||||
<a-popconfirm title="确定取消关联吗?" @confirm="() => handleDelete2(record.id)">
|
||||
<a>取消关联</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
@ -453,7 +452,7 @@
|
||||
var that = this
|
||||
console.log(this.currentDeptId)
|
||||
this.$confirm({
|
||||
title: '确认删除',
|
||||
title: '确认取消关联',
|
||||
content: '是否删除选中数据?',
|
||||
onOk: function() {
|
||||
deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
|
||||
|
||||
@ -115,7 +115,7 @@
|
||||
align:"center",
|
||||
dataIndex: 'id'
|
||||
},
|
||||
{
|
||||
/*{
|
||||
title:'开始时间',
|
||||
align:"center",
|
||||
dataIndex: 'beginDate'
|
||||
@ -124,7 +124,7 @@
|
||||
title:'结束时间',
|
||||
align:"center",
|
||||
dataIndex: 'endDate'
|
||||
},
|
||||
},*/
|
||||
{
|
||||
title:'状态',
|
||||
align:"center",
|
||||
|
||||
@ -156,10 +156,6 @@
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleAgentSettings(record.username)">代理人</a>
|
||||
</a-menu-item>
|
||||
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
@ -378,10 +374,6 @@
|
||||
handleChangePassword(username) {
|
||||
this.$refs.passwordmodal.show(username);
|
||||
},
|
||||
handleAgentSettings(username){
|
||||
this.$refs.sysUserAgentModal.agentSettings(username);
|
||||
this.$refs.sysUserAgentModal.title = "用户代理人设置";
|
||||
},
|
||||
passwordModalOk() {
|
||||
//TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
|
||||
},
|
||||
|
||||
@ -53,6 +53,9 @@
|
||||
</a-radio-group>
|
||||
</template>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="部门负责人">
|
||||
<j-select-multi-user v-model="model.directorUserIds" valueKey="id"></j-select-multi-user>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
|
||||
@ -281,6 +281,10 @@
|
||||
this.$refs.modalForm.title = "编辑";
|
||||
this.$refs.modalForm.departDisabled = true;
|
||||
this.$refs.modalForm.disableSubmit = false;
|
||||
//update-begin---author:wangshuai ---date:20220315 for:[issues/3472]给新建用户赋予角色的逻辑漏洞------------
|
||||
//部门中角色信息隐藏掉
|
||||
this.$refs.modalForm.roleDisabled = true
|
||||
//update-end---author:wangshuai ---date:20220315 for:[issues/3472]给新建用户赋予角色的逻辑漏洞------------
|
||||
this.$refs.modalForm.edit(record);
|
||||
},
|
||||
handleAdd: function () {
|
||||
@ -288,6 +292,10 @@
|
||||
this.$message.error("请选择一个部门!")
|
||||
} else {
|
||||
this.$refs.modalForm.departDisabled = true;
|
||||
//update-begin---author:wangshuai ---date:20220315 for:[issues/3472]给新建用户赋予角色的逻辑漏洞------------
|
||||
//部门中角色信息隐藏掉
|
||||
this.$refs.modalForm.roleDisabled = true
|
||||
//update-end---author:wangshuai ---date:20220315 for:[issues/3472]给新建用户赋予角色的逻辑漏洞------------
|
||||
//初始化负责部门
|
||||
this.$refs.modalForm.nextDepartOptions=[{value:this.currentDept.key,label:this.currentDept.title}]
|
||||
this.$refs.modalForm.title = "新增";
|
||||
|
||||
@ -164,7 +164,7 @@
|
||||
param.id = this.model.id
|
||||
}
|
||||
if(value){
|
||||
let reg=new RegExp("[`_~!@#$^&*()=|{}'.<>《》/?!¥()—【】‘;:”“。,、?]")
|
||||
let reg=new RegExp("[`~!@#$^&*()=|{}'.<>《》/?!¥()—【】‘;:”“。,、?]")
|
||||
if(reg.test(value)){
|
||||
callback("数据值不能包含特殊字符!")
|
||||
}else{
|
||||
|
||||
@ -28,14 +28,15 @@
|
||||
<a-divider>{{item.name}}
|
||||
<a-icon type="delete" size="22" @click="removePredicate(router,index)"/>
|
||||
</a-divider>
|
||||
<div>
|
||||
<template v-for="(tag, index) in item.args">
|
||||
<a-input v-if="index==currentTagIndex" ref="input" type="text" size="small"
|
||||
<!--当name在 genKeyRouter 时不需要指定key,后台自动拼key -->
|
||||
<div v-if="genKeyRouter.includes(item.name)">
|
||||
<template v-for="(tag, tagIndex) in item.args">
|
||||
<a-input v-if="tagIndex==currentTagIndex&&index==currentNameIndex" ref="input" type="text" size="small"
|
||||
:style="{ width: '190px' }"
|
||||
:value="tag"
|
||||
@change="handleInputChange" @blur="handleInputEditConfirm(item,tag,index)"
|
||||
@keyup.enter="handleInputEditConfirm(item,tag,index)"/>
|
||||
<a-tag v-else :key="tag" :closable="true" @close="() => removeTag(item,tag)" @click="editTag(tag,index)">
|
||||
@change="handleInputChange" @blur="handleInputEditConfirm(item,tag,tagIndex)"
|
||||
@keyup.enter="handleInputEditConfirm(item,tag,tagIndex)"/>
|
||||
<a-tag v-else :key="tag" :closable="true" @close="() => removeTag(item,tag)" @click="editTag(tag,tagIndex,index)">
|
||||
{{ tag }}
|
||||
</a-tag>
|
||||
</template>
|
||||
@ -49,11 +50,27 @@
|
||||
新建{{item.name}}
|
||||
</a-tag>
|
||||
</div>
|
||||
<!--当name不在 genKeyRouter 时需要指定key-->
|
||||
<div v-if="!genKeyRouter.includes(item.name)">
|
||||
<template v-for="(value, key) in item.args">
|
||||
<a-row>
|
||||
<a-col :span="5" style="margin-top:2px">
|
||||
<span v-if="key=='header'" >Header名称</span>
|
||||
<span v-if="key=='regexp'">参数值</span>
|
||||
<span v-if="key=='param'">参数名</span>
|
||||
<span v-if="key=='name'">Cookie名称</span>
|
||||
</a-col>
|
||||
<a-col :span="18">
|
||||
<a-input :defaultValue="value" placeholder="参数值" style="width: 70%; margin-right: 8px;margin-top: 3px" @change="(e)=>valueChange(e,item.args,key)"/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<p class="btn" style="padding-top: 10px">
|
||||
<a-dropdown>
|
||||
<a-menu slot="overlay" @click="predicatesHandleMenuClick">
|
||||
<a-menu-item :key="item" v-for="item in tagArray">{{item}}</a-menu-item>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item :key="item.name" v-for="item in tagArray" @click="predicatesHandleMenuClick(item)">{{item.name}}</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button type="dashed" style="margin-left: 8px;width:100%"> 添加路由条件
|
||||
<a-icon type="down"/>
|
||||
@ -113,8 +130,59 @@
|
||||
currentNameIndex: 0,
|
||||
currentTagIndex:-1,
|
||||
predicates: {},
|
||||
filterArray: [{ key: 0, name: '熔断器' }, { key: 1, name: '限流过滤器' }],
|
||||
tagArray: ['Path', 'Host', 'Cookie', 'Header', 'Method', 'Query', 'After', 'Before', 'Between', 'RemoteAddr'],
|
||||
filterArray: [ { key: 1, name: '限流过滤器' }],
|
||||
//gateway对应的规则key
|
||||
tagArray: [
|
||||
{
|
||||
name:'Path',
|
||||
args:[]
|
||||
},
|
||||
{
|
||||
name:'Header',
|
||||
args:{
|
||||
header:'',
|
||||
regexp:''
|
||||
}
|
||||
},
|
||||
{
|
||||
name:'Query',
|
||||
args:{
|
||||
param:'',
|
||||
regexp:''
|
||||
}
|
||||
},
|
||||
{
|
||||
name:'Method',
|
||||
args:[]
|
||||
},
|
||||
{
|
||||
name:'Host',
|
||||
args:[]
|
||||
},
|
||||
{
|
||||
name:'Cookie',
|
||||
args:{
|
||||
name:'',
|
||||
regexp:''
|
||||
}
|
||||
},
|
||||
{
|
||||
name:'After',
|
||||
args:[]
|
||||
},
|
||||
{
|
||||
name:'Before',
|
||||
args:[]
|
||||
},
|
||||
{
|
||||
name:'Between',
|
||||
args:[]
|
||||
},
|
||||
{
|
||||
name:'RemoteAddr',
|
||||
args:[]
|
||||
}
|
||||
],
|
||||
inputVisible: false,
|
||||
inputValue: '',
|
||||
url: {
|
||||
@ -124,7 +192,8 @@
|
||||
router: this.getRouter(),
|
||||
title: '路由编辑',
|
||||
visible: false,
|
||||
loading: false
|
||||
loading: false,
|
||||
genKeyRouter:["Path","Host","Method","After","Before","Between","RemoteAddr"]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -163,12 +232,22 @@
|
||||
//添加路由选项
|
||||
predicatesHandleMenuClick(e) {
|
||||
this.router.predicates.push({
|
||||
args: [],
|
||||
name: e.key
|
||||
args: e.args,
|
||||
name: e.name,
|
||||
})
|
||||
},
|
||||
editTag(tag,index){
|
||||
this.currentTagIndex=index
|
||||
editTag(tag, tagIndex,index){
|
||||
this.currentNameIndex = index;
|
||||
this.currentTagIndex=tagIndex
|
||||
},
|
||||
/**
|
||||
* 值修改事件
|
||||
* @param e
|
||||
* @param item
|
||||
* @param key
|
||||
*/
|
||||
valueChange(e,item,key){
|
||||
item[key]=e.target.value
|
||||
},
|
||||
//显示输入框
|
||||
showInput(item, index) {
|
||||
@ -226,7 +305,7 @@
|
||||
value: 20
|
||||
}],
|
||||
name:"RequestRateLimiter",
|
||||
title: this.filterArray[1].name
|
||||
title: this.filterArray[0].name
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
edit: "/sys/annountCement/edit",
|
||||
},
|
||||
userType:false,
|
||||
userIds:[],
|
||||
userIds:"",
|
||||
selectedUser:[],
|
||||
disabled:false,
|
||||
msgContent:"",
|
||||
@ -191,16 +191,19 @@
|
||||
},
|
||||
resetUser (){
|
||||
this.userType = false;
|
||||
this.userIds = [];
|
||||
//update-begin---author:wangshuai ---date:20220318 for:[issues/I4X63V]vue有些页面报错,但是在线演示的却没有-----
|
||||
this.userIds ="";
|
||||
//update-end---author:wangshuai ---date:20220318 for:[issues/I4X63V]vue有些页面报错,但是在线演示的却没有-----
|
||||
this.disabled = false;
|
||||
this.$refs.UserListModal.edit(null,null);
|
||||
},
|
||||
chooseMsgType(e) {
|
||||
if("USER" == e.target.value) {
|
||||
this.userType = true;
|
||||
} else {
|
||||
this.userType = false;
|
||||
this.userIds = [];
|
||||
//update-begin---author:wangshuai ---date:20220318 for:[issues/I4X63V]vue有些页面报错,但是在线演示的却没有-----
|
||||
this.userIds = "";
|
||||
//update-end---author:wangshuai ---date:20220318 for:[issues/I4X63V]vue有些页面报错,但是在线演示的却没有-----
|
||||
}
|
||||
},
|
||||
startTimeValidate(rule,value,callback){
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import { httpAction, postAction } from '@/api/manage'
|
||||
import { httpAction, postAction,getAction } from '@/api/manage'
|
||||
import { validateDuplicateValue } from '@/utils/util'
|
||||
|
||||
export default {
|
||||
@ -129,6 +129,7 @@
|
||||
url: {
|
||||
add: '/sys/dataSource/add',
|
||||
edit: '/sys/dataSource/edit',
|
||||
queryById: '/sys/dataSource/queryById',
|
||||
},
|
||||
dbDriverMap: {
|
||||
// MySQL 数据库
|
||||
@ -202,9 +203,17 @@
|
||||
add() {
|
||||
this.edit({})
|
||||
},
|
||||
edit(record) {
|
||||
async edit(record) {
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
//update-begin-author:liusq---date:20220705--for: 编辑时,查询获取解密后的密码 ---
|
||||
if(record.id){
|
||||
let res = await getAction(this.url.queryById, {id:record.id});
|
||||
if (res.success) {
|
||||
this.model = Object.assign({}, {...res.result})
|
||||
}
|
||||
}
|
||||
//update-end-author:liusq---date:20220705--for: 编辑时,查询获取解密后的密码 ---
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model, 'code', 'name', 'remark', 'dbType', 'dbDriver', 'dbUrl', 'dbName', 'dbUsername', 'dbPassword'))
|
||||
|
||||
@ -55,6 +55,11 @@
|
||||
ruleClass: [{ required: true, message: '规则实现类不能为空' }],
|
||||
ruleParams: [{
|
||||
validator: (rule, value, callback) => {
|
||||
//update-begin---author:wangshuai ---date:20220509 for:[VUEN-907]规则参数不是必填,如果为空不检验即可------------
|
||||
if (!value) {
|
||||
callback()
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20220509 for:[VUEN-907]规则参数不是必填,如果为空不检验即可--------------
|
||||
|
||||
try {
|
||||
let json = JSON.parse(value)
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<!-- <a-col :span="24">
|
||||
<a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-date placeholder="请选择开始时间" v-model="model.beginDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
</a-form-model-item>
|
||||
@ -24,7 +24,8 @@
|
||||
<a-form-model-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-date placeholder="请选择结束时间" v-model="model.endDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-col>-->
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-radio-group name="tenantStatus" v-model="model.status">
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
<a-radio :value="2">上级</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="departIdShow==true">
|
||||
<a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="departIdShow==true">
|
||||
<j-multi-select-tag
|
||||
:disabled="disableSubmit"
|
||||
v-model="model.departIds"
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
currdatetime: '',
|
||||
loginType: 0,
|
||||
model:{
|
||||
username: '',
|
||||
password: '',
|
||||
username: 'admin',
|
||||
password: '123456',
|
||||
inputCode: ''
|
||||
},
|
||||
validatorRules:{
|
||||
@ -136,6 +136,11 @@
|
||||
this.Login(loginParams).then((res) => {
|
||||
this.$emit('success', res.result)
|
||||
}).catch((err) => {
|
||||
//update-begin-author: taoyan date:20220425 for: 登录页面,当输入验证码错误时,验证码图片要刷新一下,而不是保持旧的验证码图片不变 #41
|
||||
if(err && err.code===412){
|
||||
this.handleChangeCheckCode();
|
||||
}
|
||||
//update-end-author: taoyan date:20220425 for: 登录页面,当输入验证码错误时,验证码图片要刷新一下,而不是保持旧的验证码图片不变 #41
|
||||
this.$emit('fail', err)
|
||||
});
|
||||
}else{
|
||||
|
||||
@ -895,10 +895,10 @@
|
||||
cssnano-preset-default "^4.0.0"
|
||||
postcss "^7.0.0"
|
||||
|
||||
"@jeecg/antd-online-mini@3.0.0-RC":
|
||||
version "3.0.0-RC"
|
||||
resolved "https://registry.npmjs.org/@jeecg/antd-online-mini/-/antd-online-mini-3.0.0-RC.tgz#8b220234d39bfcd9b8b1ce2c78ca1bd92b86da0b"
|
||||
integrity sha512-oNYRPsnlKUPpJKJvQSaqgX6XenDPKwFLHcLYFdrmEYnSCGU46x1p/coqea9r8lI6s1Y2Az0+xAOdwOMPnu/AtQ==
|
||||
"@jeecg/antd-online-mini@3.1.0-beta":
|
||||
version "3.1.0-beta"
|
||||
resolved "https://registry.npmmirror.com/@jeecg/antd-online-mini/-/antd-online-mini-3.1.0-beta.tgz#cf3e254259503405a5e83ffa6775ac9fa02fe74c"
|
||||
integrity sha512-pW0zWzExnxjlC3e7DzGYjQibLU22K/7N0kp1ddJrGgX33Ia/wq7ELOcwn6bLzITD89RcvX1JUW/om+IJ1PxOSw==
|
||||
|
||||
"@mrmlnc/readdir-enhanced@^2.2.1":
|
||||
version "2.2.1"
|
||||
|
||||
@ -1,21 +1,213 @@
|
||||
MIT License
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
Copyright (c) 2019 jeecg-boot
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
1. Definitions.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright (c) 2019 <a href="http://www.jeecg.com">Jeecg Boot</a> All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
In any case, you must not make any such use of this software as to develop software which may be considered competitive with this software.
|
||||
|
||||
开源协议补充
|
||||
JeecgBoot 是由 北京国炬信息技术有限公司 发行的软件。 总部位于北京,地址:中国·北京·朝阳区科荟前街1号院奥林佳泰大厦。邮箱:jeecgos@163.com
|
||||
本软件受适用的国家软件著作权法(包括国际条约)和双重保护许可。
|
||||
|
||||
1.允许基于本平台软件开展业务系统开发。
|
||||
2.不得基于该平台软件的基础,修改包装成一个与JeecgBoot平台软件功能类似的产品进行发布、销售,或与JeecgBoot参与同类软件产品市场的竞争。
|
||||
违反此条款属于侵权行为,须赔偿侵权经济损失,同时立即停止著作权侵权行为。
|
||||
解释权归:http://www.jeecg.com
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@ -1,15 +1,15 @@
|
||||
Jeecg-Boot 低代码开发平台
|
||||
===============
|
||||
|
||||
当前最新版本: 3.1.0(发布日期:20220301)
|
||||
当前最新版本: 3.3.0(发布日期:20220725)
|
||||
|
||||
|
||||
## 后端技术架构
|
||||
- 基础框架:Spring Boot 2.3.5.RELEASE
|
||||
- 基础框架:Spring Boot 2.6.6
|
||||
|
||||
- 持久层框架:Mybatis-plus 3.4.3.1
|
||||
- 持久层框架:Mybatis-plus 3.5.1
|
||||
|
||||
- 安全框架:Apache Shiro 1.7.0,Jwt 3.11.0
|
||||
- 安全框架:Apache Shiro 1.8.0,Jwt 3.11.0
|
||||
|
||||
- 数据库连接池:阿里巴巴Druid 1.1.22
|
||||
|
||||
@ -46,6 +46,44 @@ Jeecg-Boot 低代码开发平台
|
||||
- QQ交流群 : ⑤860162132、④774126647(满)、③816531124(满)、②769925425(满)、①284271917(满)
|
||||
|
||||
|
||||
## Docker镜像启动后台
|
||||
|
||||
|
||||
- Docker镜像单体启动 : http://doc.jeecg.com/2043889
|
||||
- Docker镜像微服务启动: http://doc.jeecg.com/2656147
|
||||
|
||||
|
||||
下面是单体启动步骤:
|
||||
```
|
||||
|
||||
注意: 如果本地安装了mysql和redis,启动容器前先停掉本地服务,不然会端口冲突。
|
||||
net stop redis
|
||||
net stop mysql
|
||||
|
||||
# 1.配置host
|
||||
127.0.0.1 jeecg-boot-redis
|
||||
127.0.0.1 jeecg-boot-mysql
|
||||
127.0.0.1 jeecg-boot-system
|
||||
|
||||
# 2.修改application-dev.yml文件的数据库和redis链接
|
||||
修改数据库连接和redis连接,将连接改成host方式
|
||||
|
||||
# 3.进jeecg-boot根目录,执行maven命令
|
||||
mvn clean package
|
||||
|
||||
# 4.启动镜像组
|
||||
docker-compose up -d
|
||||
|
||||
# 5.访问后台项目(等待2分钟左右后)
|
||||
http://localhost:8080/jeecg-boot/doc.html
|
||||
```
|
||||
|
||||
其他: 重新构建镜像组(当你改变本地代码,也可重新构建镜像)
|
||||
```
|
||||
docker-compose build
|
||||
```
|
||||
|
||||
|
||||
## 专项文档
|
||||
|
||||
#### 一、查询过滤器用法
|
||||
@ -158,38 +196,3 @@ code: {
|
||||
```
|
||||
|
||||
|
||||
## docker镜像用法
|
||||
文档: http://doc.jeecg.com/2043889
|
||||
|
||||
```
|
||||
注意: 如果本地安装了mysql和redis,启动容器前先停掉本地服务,不然会端口冲突。
|
||||
net stop redis
|
||||
net stop mysql
|
||||
|
||||
# 1.配置host
|
||||
|
||||
# jeecgboot
|
||||
127.0.0.1 jeecg-boot-redis
|
||||
127.0.0.1 jeecg-boot-mysql
|
||||
127.0.0.1 jeecg-boot-system
|
||||
|
||||
# 2.修改项目配置文件 application.yml
|
||||
active: dev
|
||||
|
||||
# 3.修改application-dev.yml文件的数据库和redis链接
|
||||
修改数据库连接和redis连接,将连接改成host方式
|
||||
|
||||
# 4.先进JAVA项目jeecg-boot根路径 maven打包
|
||||
mvn clean package
|
||||
|
||||
|
||||
# 5.构建镜像__容器组(当你改变本地代码,也可重新构建镜像)
|
||||
docker-compose build
|
||||
|
||||
|
||||
# 6.启动镜像__容器组(也可取代运行中的镜像)
|
||||
docker-compose up -d
|
||||
|
||||
# 7.访问后台项目(注意要开启swagger)
|
||||
http://localhost:8080/jeecg-boot/doc.html
|
||||
```
|
||||
File diff suppressed because one or more lines are too long
BIN
jeecg-boot/db/jeecgboot-oracle11g.dmp
Normal file
BIN
jeecg-boot/db/jeecgboot-oracle11g.dmp
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,39 +0,0 @@
|
||||
-- 第三方用户表应该加上创建人,创建时间、修改人、修改时间
|
||||
ALTER TABLE `sys_third_account`
|
||||
ADD COLUMN `create_by` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人登录名称' AFTER `third_user_id`,
|
||||
ADD COLUMN `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期' AFTER `create_by`,
|
||||
ADD COLUMN `update_by` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人登录名称' AFTER `create_time`,
|
||||
ADD COLUMN `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新日期' AFTER `update_by`;
|
||||
|
||||
-- online 表单字段db类型,区分年月日和年月日时分秒
|
||||
UPDATE onl_cgform_field SET db_type = 'Datetime' where db_type = 'Date';
|
||||
|
||||
-- 对象存储字段太短
|
||||
ALTER TABLE `oss_file`
|
||||
MODIFY COLUMN `url` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件地址' AFTER `file_name`;
|
||||
|
||||
-- 地址获取到多个地址, 地址过长导致权限菜单修改失败
|
||||
ALTER TABLE `sys_role_permission`
|
||||
MODIFY COLUMN `operate_ip` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作ip' AFTER `operate_date`;
|
||||
|
||||
-- 修改 sys_permission 下的两个字段为 tinyint 类型
|
||||
ALTER TABLE `sys_permission`
|
||||
MODIFY COLUMN `hidden` tinyint(1) NULL DEFAULT 0 COMMENT '是否隐藏路由: 0否,1是' AFTER `keep_alive`,
|
||||
MODIFY COLUMN `hide_tab` tinyint(1) NULL DEFAULT NULL COMMENT '是否隐藏tab: 0否,1是' AFTER `hidden`;
|
||||
|
||||
-- 默认示例,内嵌百度改成jeecg.com官网
|
||||
UPDATE sys_permission SET name = 'JEECG官方网站' , url = 'http://www.jeecg.com' WHERE id = 'a400e4f4d54f79bf5ce160ae432231af';
|
||||
|
||||
-- 菜单名和代码改名 erp风格
|
||||
UPDATE `sys_permission` SET `parent_id` = '2a470fc0c3954d9dbb61de6d80846549', `name` = '一对多erp风格示例', `url` = '/jeecg/tablist/JeecgOrderDMainList', `component` = 'jeecg/tablist/JeecgOrderDMainList', `component_name` = NULL, `redirect` = NULL, `menu_type` = 1, `perms` = NULL, `perms_type` = NULL, `sort_no` = 2.00, `always_show` = 0, `icon` = NULL, `is_route` = 1, `is_leaf` = 1, `keep_alive` = 0, `hidden` = 0, `description` = NULL, `status` = NULL, `del_flag` = 0, `rule_flag` = 0, `create_by` = 'admin', `create_time` = '2019-02-20 14:45:09', `update_by` = 'admin', `update_time` = '2022-01-17 17:02:51', `internal_or_external` = 0, `hide_tab` = '0' WHERE `id` = '6ad53fd1b220989a8b71ff482d683a5a';
|
||||
|
||||
-- 分类字典 列表页 显示数据id
|
||||
UPDATE sys_category SET code='B01-2-3' WHERE id='1404629269499936770';
|
||||
UPDATE sys_category SET code='B01-2-2' WHERE id='937fd2e9aa13b8bab1da1ca36d3fd344';
|
||||
|
||||
-- 新的表格合计菜单
|
||||
INSERT INTO `sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `status`, `del_flag`, `rule_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `internal_or_external`, `hide_tab`) VALUES ('1494641317580423169', '2a470fc0c3954d9dbb61de6d80846549', '表格合计News', '/jeecg/tableOrderTotal', 'jeecg/TableOrderTotal', NULL, NULL, 1, NULL, '1', 3.00, 0, NULL, 1, 1, 0, 0, NULL, '1', 0, 0, 'admin', '2022-02-18 19:53:54', 'admin', '2022-02-18 19:55:04', 0, '0');
|
||||
|
||||
-- online老数据,存在字符串类型key值不一致的情况,String改为string
|
||||
UPDATE onl_cgform_field SET db_type = 'string' where binary db_type = 'String';
|
||||
|
||||
32
jeecg-boot/db/增量SQL/3.2升级到3.3增量脚本sql
Normal file
32
jeecg-boot/db/增量SQL/3.2升级到3.3增量脚本sql
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
ALTER TABLE `sys_user`
|
||||
MODIFY COLUMN `org_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '登录会话的机构编码' AFTER `phone`;
|
||||
|
||||
ALTER TABLE `sys_role_index`
|
||||
ADD COLUMN `component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件' AFTER `url`,
|
||||
ADD COLUMN `is_route` tinyint(1) NULL DEFAULT 1 COMMENT '是否路由菜单: 0:不是 1:是(默认值1)' AFTER `component`;
|
||||
|
||||
ALTER TABLE `jeecg_order_main`
|
||||
ADD COLUMN `bpm_status` varchar(3) NULL COMMENT '流程状态' AFTER `update_time`;
|
||||
|
||||
UPDATE `sys_dict_item` SET `dict_id` = '4f69be5f507accea8d5df5f11346181a', `item_text` = '文本', `item_value` = '1', `description` = '', `sort_order` = 1, `status` = 1, `create_by` = 'admin', `create_time` = '2023-02-28 10:50:36', `update_by` = 'admin', `update_time` = '2022-07-04 16:29:21' WHERE `id` = '222705e11ef0264d4214affff1fb4ff9';
|
||||
UPDATE `sys_dict_item` SET `dict_id` = '4f69be5f507accea8d5df5f11346181a', `item_text` = '富文本', `item_value` = '2', `description` = '', `sort_order` = 2, `status` = 1, `create_by` = 'admin', `create_time` = '2031-02-28 10:50:44', `update_by` = 'admin', `update_time` = '2022-07-04 16:29:30' WHERE `id` = '6a7a9e1403a7943aba69e54ebeff9762';
|
||||
delete from sys_dict_item where id in ('1199607547704647681', '8bccb963e1cd9e8d42482c54cc609ca2');
|
||||
update sys_sms_template set template_type = '2' where template_type='4';
|
||||
update sys_sms_template set template_type = '1' where template_type='3';
|
||||
|
||||
ALTER TABLE `sys_sms_template`
|
||||
ADD COLUMN `use_status` varchar(1) NULL COMMENT '是否使用中 1是0否' AFTER `update_by`;
|
||||
|
||||
ALTER TABLE `sys_sms`
|
||||
MODIFY COLUMN `es_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发送方式:参考枚举MessageTypeEnum' AFTER `es_title`;
|
||||
|
||||
|
||||
ALTER TABLE jimu_report_data_source
|
||||
ADD COLUMN tenant_id varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '多租户标识' AFTER connect_times;
|
||||
|
||||
ALTER TABLE jimu_dict
|
||||
ADD COLUMN tenant_id varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '多租户标识' AFTER type;
|
||||
|
||||
ALTER TABLE jimu_report
|
||||
ADD COLUMN tenant_id varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '多租户标识' AFTER js_str;
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-boot-base-api</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
package org.jeecg.common.bpm.api;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.online.api.factory.OnlineBaseExtAPIFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 流程接口
|
||||
*
|
||||
* @author scott
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "bpmBaseRemoteApi", value = ServiceNameConstants.SYSTEM_SERVICE,
|
||||
fallbackFactory = OnlineBaseExtAPIFallbackFactory.class)
|
||||
public interface IBpmBaseExtAPI {
|
||||
/**
|
||||
* 23. 流程提交接口(online,自定义开发)
|
||||
*
|
||||
* @param flowCode
|
||||
* 流程业务关联 例如:joa_leave_01
|
||||
* @param id
|
||||
* 表单业务数据data id
|
||||
* @param formUrl
|
||||
* 流程审批时附件页面默认展示的PC端表单组件(地址)
|
||||
* @param formUrlMobile
|
||||
* 流程审批时附件页面默认展示的移动端表单组件(地址)
|
||||
* @param username
|
||||
* 流程发起人账号
|
||||
* @param jsonData
|
||||
* Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping(value = "/act/process/extActProcess/startMutilProcess")
|
||||
Result<String> startMutilProcess(@RequestParam("flowCode") String flowCode, @RequestParam("id") String id,
|
||||
@RequestParam("formUrl") String formUrl, @RequestParam("formUrlMobile") String formUrlMobile,
|
||||
@RequestParam("username") String username, @RequestParam("jsonData") String jsonData) throws Exception;
|
||||
|
||||
/**
|
||||
* 24. 流程提交接口(自定义表单设计器)
|
||||
*
|
||||
* @param flowCode
|
||||
* 流程业务关联 例如:joa_leave_01
|
||||
* @param id
|
||||
* 表单业务数据data id
|
||||
* @param formUrl
|
||||
* 流程审批时附件页面默认展示的PC端表单组件(地址)
|
||||
* @param formUrlMobile
|
||||
* 流程审批时附件页面默认展示的移动端表单组件(地址)
|
||||
* @param username
|
||||
* 流程发起人账号
|
||||
* @param jsonData
|
||||
* Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping(value = "/act/process/extActProcess/startDesFormMutilProcess")
|
||||
Result<String> startDesFormMutilProcess(@RequestParam("flowCode") String flowCode, @RequestParam("id") String id,
|
||||
@RequestParam("formUrl") String formUrl, @RequestParam("formUrlMobile") String formUrlMobile,
|
||||
@RequestParam("username") String username, @RequestParam("jsonData") String jsonData) throws Exception;
|
||||
|
||||
/**
|
||||
* 25. 保存流程草稿箱接口(自定义开发表单、online表单)
|
||||
*
|
||||
* @param flowCode
|
||||
* 流程业务关联 例如:joa_leave_01
|
||||
* @param id
|
||||
* 表单业务数据data id
|
||||
* @param formUrl
|
||||
* 流程审批时附件页面默认展示的PC端表单组件(地址) 【非必填】
|
||||
* @param formUrlMobile
|
||||
* 流程审批时附件页面默认展示的移动端表单组件(地址) 【非必填】
|
||||
* @param username
|
||||
* 流程发起人账号
|
||||
* @param jsonData
|
||||
* Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping(value = "/act/process/extActProcess/saveMutilProcessDraft")
|
||||
Result<String> saveMutilProcessDraft(@RequestParam("flowCode") String flowCode, @RequestParam("id") String id,
|
||||
@RequestParam("formUrl") String formUrl, @RequestParam("formUrlMobile") String formUrlMobile,
|
||||
@RequestParam("username") String username, @RequestParam("jsonData") String jsonData) throws Exception;
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package org.jeecg.common.bpm.api.factory;
|
||||
|
||||
import org.jeecg.common.bpm.api.IBpmBaseExtAPI;
|
||||
import org.jeecg.common.bpm.api.fallback.BpmBaseExtAPIFallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import feign.hystrix.FallbackFactory;
|
||||
|
||||
@Component
|
||||
public class BpmBaseExtAPIFallbackFactory implements FallbackFactory<IBpmBaseExtAPI> {
|
||||
|
||||
@Override
|
||||
public IBpmBaseExtAPI create(Throwable throwable) {
|
||||
BpmBaseExtAPIFallback fallback = new BpmBaseExtAPIFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
package org.jeecg.common.bpm.api.fallback;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.bpm.api.IBpmBaseExtAPI;
|
||||
import org.jeecg.common.online.api.IOnlineBaseExtAPI;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 进入fallback的方法 检查是否token未设置
|
||||
*/
|
||||
@Slf4j
|
||||
public class BpmBaseExtAPIFallback implements IBpmBaseExtAPI {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public Result<String> startMutilProcess(String flowCode, String id, String formUrl, String formUrlMobile,
|
||||
String username, String jsonData) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> startDesFormMutilProcess(String flowCode, String id, String formUrl, String formUrlMobile,
|
||||
String username, String jsonData) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> saveMutilProcessDraft(String flowCode, String id, String formUrl, String formUrlMobile,
|
||||
String username, String jsonData) throws Exception {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1,73 +0,0 @@
|
||||
package org.jeecg.common.online.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.online.api.factory.OnlineBaseExtAPIFallbackFactory;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 【Online】Feign API接口
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "onlineBaseRemoteApi", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = OnlineBaseExtAPIFallbackFactory.class)
|
||||
//@FeignClient(contextId = "onlineBaseRemoteApi", value = ServiceNameConstants.SYSTEM_ONLINE, fallbackFactory = OnlineBaseExtAPIFallbackFactory.class)
|
||||
public interface IOnlineBaseExtAPI {
|
||||
|
||||
/**
|
||||
* 【Online】 表单设计器专用:同步新增
|
||||
*/
|
||||
@PostMapping(value = "/online/api/cgform/crazyForm/{name}")
|
||||
String cgformPostCrazyForm(@PathVariable("name") String tableName, @RequestBody JSONObject jsonObject) throws Exception;
|
||||
|
||||
/**
|
||||
* 【Online】 表单设计器专用:同步编辑
|
||||
*/
|
||||
@PutMapping(value = "/online/api/cgform/crazyForm/{name}")
|
||||
String cgformPutCrazyForm(@PathVariable("name") String tableName, @RequestBody JSONObject jsonObject) throws Exception;
|
||||
|
||||
/**
|
||||
* 通过online表名查询数据,同时查询出子表的数据
|
||||
*
|
||||
* @param tableName online表名
|
||||
* @param dataIds online数据ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/online/api/cgform/queryAllDataByTableName")
|
||||
JSONObject cgformQueryAllDataByTableName(@RequestParam("tableName") String tableName, @RequestParam("dataIds") String dataIds);
|
||||
|
||||
/**
|
||||
* online表单删除数据
|
||||
*
|
||||
* @param cgformCode Online表单code
|
||||
* @param dataIds 数据ID,可逗号分割
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/online/api/cgform/cgformDeleteDataByCode")
|
||||
String cgformDeleteDataByCode(@RequestParam("cgformCode") String cgformCode, @RequestParam("dataIds") String dataIds);
|
||||
|
||||
/**
|
||||
* 【cgreport】通过 head code 获取 sql语句,并执行该语句返回查询数据
|
||||
*
|
||||
* @param code 报表Code,如果没传ID就通过code查
|
||||
* @param forceKey
|
||||
* @param dataList
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/online/api/cgreportGetData")
|
||||
Map<String, Object> cgreportGetData(@RequestParam("code") String code, @RequestParam("forceKey") String forceKey, @RequestParam("dataList") String dataList);
|
||||
|
||||
/**
|
||||
* 【cgreport】对 cgreportGetData 的返回值做优化,封装 DictModel 集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/online/api/cgreportGetDataPackage")
|
||||
List<DictModel> cgreportGetDataPackage(@RequestParam("code") String code, @RequestParam("dictText") String dictText, @RequestParam("dictCode") String dictCode, @RequestParam("dataList") String dataList);
|
||||
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package org.jeecg.common.online.api.factory;
|
||||
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import org.jeecg.common.online.api.IOnlineBaseExtAPI;
|
||||
import org.jeecg.common.online.api.fallback.OnlineBaseExtAPIFallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class OnlineBaseExtAPIFallbackFactory implements FallbackFactory<IOnlineBaseExtAPI> {
|
||||
|
||||
@Override
|
||||
public IOnlineBaseExtAPI create(Throwable throwable) {
|
||||
OnlineBaseExtAPIFallback fallback = new OnlineBaseExtAPIFallback();
|
||||
fallback.setCause(throwable);
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
package org.jeecg.common.online.api.fallback;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.online.api.IOnlineBaseExtAPI;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 进入fallback的方法 检查是否token未设置
|
||||
*/
|
||||
@Slf4j
|
||||
public class OnlineBaseExtAPIFallback implements IOnlineBaseExtAPI {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public String cgformPostCrazyForm(String tableName, JSONObject jsonObject) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cgformPutCrazyForm(String tableName, JSONObject jsonObject) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject cgformQueryAllDataByTableName(String tableName, String dataIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cgformDeleteDataByCode(String cgformCode, String dataIds) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> cgreportGetData(String code, String forceKey, String dataList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictModel> cgreportGetDataPackage(String code, String dictText, String dictCode, String dataList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,6 +7,7 @@ import org.jeecg.common.api.dto.message.*;
|
||||
import org.jeecg.common.constant.ServiceNameConstants;
|
||||
import org.jeecg.common.system.api.factory.SysBaseAPIFallbackFactory;
|
||||
import org.jeecg.common.system.vo.*;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -16,18 +17,17 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 相比较local版
|
||||
* 去掉了一些方法:
|
||||
* addLog getDatabaseType queryAllDepart
|
||||
* queryAllUser(Wrapper wrapper) queryAllUser(String[] userIds, int pageNo, int pageSize)
|
||||
* 修改了一些方法:
|
||||
* createLog
|
||||
* sendSysAnnouncement 只保留了一个,其余全部干掉
|
||||
*
|
||||
* cloud接口数量43 local:35 common:9 额外一个特殊queryAllRole一个当两个用
|
||||
* 1、cloud接口数量43 local:35 common:9 额外一个特殊queryAllRole一个当两个用
|
||||
* - 相比较local版
|
||||
* - 去掉了一些方法:addLog、getDatabaseType、queryAllDepart、queryAllUser(Wrapper wrapper)、queryAllUser(String[] userIds, int pageNo, int pageSize)
|
||||
* - 修改了一些方法:createLog、sendSysAnnouncement(只保留了一个,其余全部干掉)
|
||||
* 2、@ConditionalOnMissingClass("org.jeecg.modules.system.service.impl.SysBaseApiImpl")=> 有实现类的时候,不实例化Feign接口
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "sysBaseRemoteApi", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = SysBaseAPIFallbackFactory.class)
|
||||
@FeignClient(contextId = "sysBaseRemoteApi", value = ServiceNameConstants.SERVICE_SYSTEM, fallbackFactory = SysBaseAPIFallbackFactory.class)
|
||||
@ConditionalOnMissingClass("org.jeecg.modules.system.service.impl.SysBaseApiImpl")
|
||||
public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
@ -103,6 +103,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryDictItemsByCode")
|
||||
List<DictModel> queryDictItemsByCode(@RequestParam("code") String code);
|
||||
|
||||
@ -111,10 +112,13 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryEnableDictItemsByCode")
|
||||
public List<DictModel> queryEnableDictItemsByCode(@RequestParam("code") String code);
|
||||
|
||||
/** 11查询所有的父级字典,按照create_time排序 */
|
||||
/** 11查询所有的父级字典,按照create_time排序
|
||||
* @return List<DictModel> 字典值集合
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllDict")
|
||||
List<DictModel> queryAllDict();
|
||||
|
||||
@ -122,8 +126,8 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* 12查询所有分类字典
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllDSysCategory")
|
||||
List<SysCategoryModel> queryAllDSysCategory();
|
||||
@GetMapping("/sys/api/queryAllSysCategory")
|
||||
List<SysCategoryModel> queryAllSysCategory();
|
||||
|
||||
/**
|
||||
* 13获取表数据字典
|
||||
@ -132,6 +136,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryTableDictItemsByCode")
|
||||
List<DictModel> queryTableDictItemsByCode(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code);
|
||||
|
||||
@ -144,6 +149,8 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 15根据业务类型 busType 及业务 busId 修改消息已读
|
||||
* @param busType 业务类型
|
||||
* @param busId 业务id
|
||||
*/
|
||||
@GetMapping("/sys/api/updateSysAnnounReadFlag")
|
||||
public void updateSysAnnounReadFlag(@RequestParam("busType") String busType, @RequestParam("busId")String busId);
|
||||
@ -180,6 +187,9 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 19分页查询用户 返回JSONObject
|
||||
* @param userIds 多个用户id
|
||||
* @param pageNo 当前页数
|
||||
* @param pageSize 每页条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllUser")
|
||||
@ -188,7 +198,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 20获取所有角色 带参
|
||||
* roleIds 默认选中角色
|
||||
* @param roleIds 默认选中角色
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllRole")
|
||||
@ -243,7 +253,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 27根据id获取所有参与用户
|
||||
* userIds
|
||||
* @param userIds 多个用户id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryAllUserByIds")
|
||||
@ -260,7 +270,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 29根据name获取所有参与用户
|
||||
* userNames
|
||||
* @param userNames 多个用户账号
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/queryUserByNames")
|
||||
@ -293,6 +303,8 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 33通过部门id获取部门全部信息
|
||||
* @param id 部门id
|
||||
* @return SysDepartModel 部门信息
|
||||
*/
|
||||
@GetMapping("/sys/api/selectAllById")
|
||||
SysDepartModel selectAllById(@RequestParam("id") String id);
|
||||
@ -313,6 +325,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryUserRoles")
|
||||
Set<String> queryUserRoles(@RequestParam("username")String username);
|
||||
|
||||
@ -321,6 +334,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryUserAuths")
|
||||
Set<String> queryUserAuths(@RequestParam("username")String username);
|
||||
|
||||
@ -330,6 +344,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param dbSourceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/getDynamicDbSourceById")
|
||||
DynamicDataSourceModel getDynamicDbSourceById(@RequestParam("dbSourceId") String dbSourceId);
|
||||
|
||||
@ -339,13 +354,16 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param dbSourceCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/getDynamicDbSourceByCode")
|
||||
DynamicDataSourceModel getDynamicDbSourceByCode(@RequestParam("dbSourceCode") String dbSourceCode);
|
||||
|
||||
/**
|
||||
* 39根据用户账号查询用户信息 CommonAPI中定义
|
||||
* @param username
|
||||
* @return LoginUser 用户信息
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/getUserByName")
|
||||
LoginUser getUserByName(@RequestParam("username") String username);
|
||||
|
||||
@ -357,6 +375,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/translateDictFromTable")
|
||||
String translateDictFromTable(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("key") String key);
|
||||
|
||||
@ -366,13 +385,18 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/translateDict")
|
||||
String translateDict(@RequestParam("code") String code, @RequestParam("key") String key);
|
||||
|
||||
/**
|
||||
* 42查询数据权限
|
||||
* @param component
|
||||
* @param requestPath
|
||||
* @param username 用户姓名
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/queryPermissionDataRule")
|
||||
List<SysPermissionDataRuleModel> queryPermissionDataRule(@RequestParam("component") String component, @RequestParam("requestPath")String requestPath, @RequestParam("username") String username);
|
||||
|
||||
@ -381,6 +405,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/sys/api/getCacheUser")
|
||||
SysUserCacheInfo getCacheUser(@RequestParam("username") String username);
|
||||
|
||||
@ -426,13 +451,16 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
void sendEmailMsg(@RequestParam("email")String email,@RequestParam("title")String title,@RequestParam("content")String content);
|
||||
/**
|
||||
* 41 获取公司下级部门和公司下所有用户id
|
||||
* @param orgCode
|
||||
* @param orgCode 部门编号
|
||||
* @return List<Map>
|
||||
*/
|
||||
@GetMapping("/sys/api/getDeptUserByOrgCode")
|
||||
List<Map> getDeptUserByOrgCode(@RequestParam("orgCode")String orgCode);
|
||||
|
||||
/**
|
||||
* 42 查询分类字典翻译
|
||||
* @param ids 多个分类字典id
|
||||
* @return List<String>
|
||||
*/
|
||||
@GetMapping("/sys/api/loadCategoryDictItem")
|
||||
List<String> loadCategoryDictItem(@RequestParam("ids") String ids);
|
||||
@ -472,6 +500,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*
|
||||
* @param dictCode 字典code格式:table,text,code
|
||||
* @param keyword 过滤关键字
|
||||
* @param pageSize 每页条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/loadDictItemByKeyword")
|
||||
@ -507,4 +536,17 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
@GetMapping("/sys/api/translateDictFromTableByKeys")
|
||||
List<DictModel> translateDictFromTableByKeys(@RequestParam("table") String table, @RequestParam("text") String text, @RequestParam("code") String code, @RequestParam("keys") String keys);
|
||||
|
||||
/**
|
||||
* 发送模板消息
|
||||
*/
|
||||
@PostMapping("/sys/api/sendTemplateMessage")
|
||||
void sendTemplateMessage(@RequestBody MessageDTO message);
|
||||
|
||||
/**
|
||||
* 获取模板内容
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sys/api/getTemplateContent")
|
||||
String getTemplateContent(@RequestParam("code") String code);
|
||||
}
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
package org.jeecg.common.system.api.factory;
|
||||
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.system.api.fallback.SysBaseAPIFallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description: SysBaseAPIFallbackFactory
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component
|
||||
public class SysBaseAPIFallbackFactory implements FallbackFactory<ISysBaseAPI> {
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* 进入fallback的方法 检查是否token未设置
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Slf4j
|
||||
public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
@ -79,11 +80,12 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
|
||||
@Override
|
||||
public List<DictModel> queryAllDict() {
|
||||
log.error("fegin接口queryAllDict失败:"+cause.getMessage(), cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysCategoryModel> queryAllDSysCategory() {
|
||||
public List<SysCategoryModel> queryAllSysCategory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -221,7 +223,7 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
|
||||
@Override
|
||||
public LoginUser getUserByName(String username) {
|
||||
log.error("通过用户名获取当前登录用户信息 {}", cause);
|
||||
log.error("jeecg-system服务节点不通,导致获取登录用户信息失败: " + cause.getMessage(), cause);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -276,6 +278,15 @@ public class SysBaseAPIFallback implements ISysBaseAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendTemplateMessage(MessageDTO message) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateContent(String code) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEmailMsg(String email,String title,String content) {
|
||||
|
||||
|
||||
@ -1,164 +1,180 @@
|
||||
package org.jeecg.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.jeecg.common.config.mqtoken.UserTokenContext;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.util.PathMatcherUtil;
|
||||
import org.jeecg.config.sign.interceptor.SignAuthConfiguration;
|
||||
import org.jeecg.config.sign.util.HttpUtils;
|
||||
import org.jeecg.config.sign.util.SignUtil;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
|
||||
import org.springframework.cloud.openfeign.support.SpringDecoder;
|
||||
import org.springframework.cloud.openfeign.support.SpringEncoder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import com.alibaba.fastjson.support.springfox.SwaggerJsonSerializer;
|
||||
|
||||
import feign.Feign;
|
||||
import feign.Logger;
|
||||
import feign.RequestInterceptor;
|
||||
import feign.codec.Decoder;
|
||||
import feign.codec.Encoder;
|
||||
import feign.form.spring.SpringFormEncoder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ConditionalOnClass(Feign.class)
|
||||
@AutoConfigureBefore(FeignAutoConfiguration.class)
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class FeignConfig {
|
||||
|
||||
@Bean
|
||||
public RequestInterceptor requestInterceptor() {
|
||||
return requestTemplate -> {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (null != attributes) {
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
log.debug("Feign request: {}", request.getRequestURI());
|
||||
// 将token信息放入header中
|
||||
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||
if(token==null || "".equals(token)){
|
||||
token = request.getParameter("token");
|
||||
}
|
||||
log.debug("Feign request token: {}", token);
|
||||
requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token);
|
||||
|
||||
//根据URL地址过滤请求 【字典表参数签名验证】
|
||||
if (PathMatcherUtil.matches(Arrays.asList(SignAuthConfiguration.urlList),requestTemplate.path())) {
|
||||
try {
|
||||
log.info("============================ [begin] fegin api url ============================");
|
||||
log.info(requestTemplate.path());
|
||||
log.info(requestTemplate.method());
|
||||
String queryLine = requestTemplate.queryLine();
|
||||
if(queryLine!=null && queryLine.startsWith("?")){
|
||||
queryLine = queryLine.substring(1);
|
||||
}
|
||||
log.info(queryLine);
|
||||
if(requestTemplate.body()!=null){
|
||||
log.info(new String(requestTemplate.body()));
|
||||
}
|
||||
SortedMap<String, String> allParams = HttpUtils.getAllParams(requestTemplate.path(),queryLine,requestTemplate.body(),requestTemplate.method());
|
||||
String sign = SignUtil.getParamsSign(allParams);
|
||||
log.info(" Feign request params sign: {}",sign);
|
||||
log.info("============================ [end] fegin api url ============================");
|
||||
requestTemplate.header(CommonConstant.X_SIGN, sign);
|
||||
requestTemplate.header(CommonConstant.X_TIMESTAMP, DateUtils.getCurrentTimestamp().toString());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
String token = UserTokenContext.getToken();
|
||||
log.debug("Feign request token: {}", token);
|
||||
requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Feign 客户端的日志记录,默认级别为NONE
|
||||
* Logger.Level 的具体级别如下:
|
||||
* NONE:不记录任何信息
|
||||
* BASIC:仅记录请求方法、URL以及响应状态码和执行时间
|
||||
* HEADERS:除了记录 BASIC级别的信息外,还会记录请求和响应的头信息
|
||||
* FULL:记录所有请求与响应的明细,包括头信息、请求体、元数据
|
||||
*/
|
||||
@Bean
|
||||
Logger.Level feignLoggerLevel() {
|
||||
return Logger.Level.FULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Feign支持文件上传
|
||||
* @param messageConverters
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
@Primary
|
||||
@Scope("prototype")
|
||||
public Encoder multipartFormEncoder(ObjectFactory<HttpMessageConverters> messageConverters) {
|
||||
return new SpringFormEncoder(new SpringEncoder(messageConverters));
|
||||
}
|
||||
|
||||
// update-begin--Author:sunjianlei Date:20210604 for: 给 Feign 添加 FastJson 的解析支持 ----------
|
||||
@Bean
|
||||
public Encoder feignEncoder() {
|
||||
return new SpringEncoder(feignHttpMessageConverter());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Decoder feignDecoder() {
|
||||
return new SpringDecoder(feignHttpMessageConverter());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置解码器为fastjson
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private ObjectFactory<HttpMessageConverters> feignHttpMessageConverter() {
|
||||
final HttpMessageConverters httpMessageConverters = new HttpMessageConverters(this.getFastJsonConverter());
|
||||
return () -> httpMessageConverters;
|
||||
}
|
||||
|
||||
private FastJsonHttpMessageConverter getFastJsonConverter() {
|
||||
FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
|
||||
|
||||
List<MediaType> supportedMediaTypes = new ArrayList<>();
|
||||
MediaType mediaTypeJson = MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE);
|
||||
supportedMediaTypes.add(mediaTypeJson);
|
||||
converter.setSupportedMediaTypes(supportedMediaTypes);
|
||||
FastJsonConfig config = new FastJsonConfig();
|
||||
config.getSerializeConfig().put(JSON.class, new SwaggerJsonSerializer());
|
||||
config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect);
|
||||
converter.setFastJsonConfig(config);
|
||||
|
||||
return converter;
|
||||
}
|
||||
// update-end--Author:sunjianlei Date:20210604 for: 给 Feign 添加 FastJson 的解析支持 ----------
|
||||
|
||||
}
|
||||
//package org.jeecg.config;
|
||||
//
|
||||
//import java.io.IOException;
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.Arrays;
|
||||
//import java.util.List;
|
||||
//import java.util.SortedMap;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//
|
||||
//import org.jeecg.common.config.mqtoken.UserTokenContext;
|
||||
//import org.jeecg.common.constant.CommonConstant;
|
||||
//import org.jeecg.common.util.DateUtils;
|
||||
//import org.jeecg.common.util.PathMatcherUtil;
|
||||
//import org.jeecg.config.sign.interceptor.SignAuthConfiguration;
|
||||
//import org.jeecg.config.sign.util.HttpUtils;
|
||||
//import org.jeecg.config.sign.util.SignUtil;
|
||||
//import org.springframework.beans.factory.ObjectFactory;
|
||||
//import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
//import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
//import org.springframework.cloud.openfeign.FeignAutoConfiguration;
|
||||
//import org.springframework.cloud.openfeign.support.SpringDecoder;
|
||||
//import org.springframework.cloud.openfeign.support.SpringEncoder;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.context.annotation.Primary;
|
||||
//import org.springframework.context.annotation.Scope;
|
||||
//import org.springframework.http.MediaType;
|
||||
//import org.springframework.web.context.request.RequestContextHolder;
|
||||
//import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
//
|
||||
//import com.alibaba.fastjson.JSON;
|
||||
//import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
//import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
//import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
//import com.alibaba.fastjson.support.springfox.SwaggerJsonSerializer;
|
||||
//
|
||||
//import feign.Feign;
|
||||
//import feign.Logger;
|
||||
//import feign.RequestInterceptor;
|
||||
//import feign.codec.Decoder;
|
||||
//import feign.codec.Encoder;
|
||||
//import feign.form.spring.SpringFormEncoder;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//
|
||||
///**
|
||||
// * @Description: FeignConfig
|
||||
// * @author: JeecgBoot
|
||||
// */
|
||||
//@ConditionalOnClass(Feign.class)
|
||||
//@AutoConfigureBefore(FeignAutoConfiguration.class)
|
||||
//@Slf4j
|
||||
//@Configuration
|
||||
//public class FeignConfig {
|
||||
//
|
||||
// /**
|
||||
// * 设置feign header参数
|
||||
// * 【X_ACCESS_TOKEN】【X_SIGN】【X_TIMESTAMP】
|
||||
// * @return
|
||||
// */
|
||||
// @Bean
|
||||
// public RequestInterceptor requestInterceptor() {
|
||||
// return requestTemplate -> {
|
||||
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
// if (null != attributes) {
|
||||
// HttpServletRequest request = attributes.getRequest();
|
||||
// log.debug("Feign request: {}", request.getRequestURI());
|
||||
// // 将token信息放入header中
|
||||
// String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||
// if(token==null || "".equals(token)){
|
||||
// token = request.getParameter("token");
|
||||
// }
|
||||
// log.info("Feign Login Request token: {}", token);
|
||||
// requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token);
|
||||
// }else{
|
||||
// //解决后台任务、MQ中调用feign接口,无会话token的问题
|
||||
// String token = UserTokenContext.getToken();
|
||||
// log.info("Feign No Login token: {}", token);
|
||||
// requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token);
|
||||
// }
|
||||
//
|
||||
// //================================================================================================================
|
||||
// //针对特殊接口,进行加签验证 ——根据URL地址过滤请求 【字典表参数签名验证】
|
||||
// if (PathMatcherUtil.matches(Arrays.asList(SignAuthConfiguration.SIGN_URL_LIST),requestTemplate.path())) {
|
||||
// try {
|
||||
// log.info("============================ [begin] fegin api url ============================");
|
||||
// log.info(requestTemplate.path());
|
||||
// log.info(requestTemplate.method());
|
||||
// String queryLine = requestTemplate.queryLine();
|
||||
// String questionMark="?";
|
||||
// if(queryLine!=null && queryLine.startsWith(questionMark)){
|
||||
// queryLine = queryLine.substring(1);
|
||||
// }
|
||||
// log.info(queryLine);
|
||||
// if(requestTemplate.body()!=null){
|
||||
// log.info(new String(requestTemplate.body()));
|
||||
// }
|
||||
// SortedMap<String, String> allParams = HttpUtils.getAllParams(requestTemplate.path(),queryLine,requestTemplate.body(),requestTemplate.method());
|
||||
// String sign = SignUtil.getParamsSign(allParams);
|
||||
// log.info(" Feign request params sign: {}",sign);
|
||||
// log.info("============================ [end] fegin api url ============================");
|
||||
// requestTemplate.header(CommonConstant.X_SIGN, sign);
|
||||
// requestTemplate.header(CommonConstant.X_TIMESTAMP, String.valueOf(System.currentTimeMillis()));
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// //================================================================================================================
|
||||
// };
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * Feign 客户端的日志记录,默认级别为NONE
|
||||
// * Logger.Level 的具体级别如下:
|
||||
// * NONE:不记录任何信息
|
||||
// * BASIC:仅记录请求方法、URL以及响应状态码和执行时间
|
||||
// * HEADERS:除了记录 BASIC级别的信息外,还会记录请求和响应的头信息
|
||||
// * FULL:记录所有请求与响应的明细,包括头信息、请求体、元数据
|
||||
// */
|
||||
// @Bean
|
||||
// Logger.Level feignLoggerLevel() {
|
||||
// return Logger.Level.FULL;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Feign支持文件上传
|
||||
// * @param messageConverters
|
||||
// * @return
|
||||
// */
|
||||
// @Bean
|
||||
// @Primary
|
||||
// @Scope("prototype")
|
||||
// public Encoder multipartFormEncoder(ObjectFactory<HttpMessageConverters> messageConverters) {
|
||||
// return new SpringFormEncoder(new SpringEncoder(messageConverters));
|
||||
// }
|
||||
//
|
||||
// // update-begin--Author:sunjianlei Date:20210604 for: 给 Feign 添加 FastJson 的解析支持 ----------
|
||||
// /**
|
||||
// * 给 Feign 添加 FastJson 的解析支持
|
||||
// */
|
||||
// @Bean
|
||||
// public Encoder feignEncoder() {
|
||||
// return new SpringEncoder(feignHttpMessageConverter());
|
||||
// }
|
||||
//
|
||||
// @Bean("apiFeignDecoder")
|
||||
// public Decoder feignDecoder() {
|
||||
// return new SpringDecoder(feignHttpMessageConverter());
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 设置解码器为fastjson
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// private ObjectFactory<HttpMessageConverters> feignHttpMessageConverter() {
|
||||
// final HttpMessageConverters httpMessageConverters = new HttpMessageConverters(this.getFastJsonConverter());
|
||||
// return () -> httpMessageConverters;
|
||||
// }
|
||||
//
|
||||
// private FastJsonHttpMessageConverter getFastJsonConverter() {
|
||||
// FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
|
||||
//
|
||||
// List<MediaType> supportedMediaTypes = new ArrayList<>();
|
||||
// MediaType mediaTypeJson = MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE);
|
||||
// supportedMediaTypes.add(mediaTypeJson);
|
||||
// converter.setSupportedMediaTypes(supportedMediaTypes);
|
||||
// FastJsonConfig config = new FastJsonConfig();
|
||||
// config.getSerializeConfig().put(JSON.class, new SwaggerJsonSerializer());
|
||||
// config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect);
|
||||
// converter.setFastJsonConfig(config);
|
||||
//
|
||||
// return converter;
|
||||
// }
|
||||
// // update-end--Author:sunjianlei Date:20210604 for: 给 Feign 添加 FastJson 的解析支持 ----------
|
||||
//
|
||||
//}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-boot-base-api</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
package org.jeecg.common.bpm.api;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 流程接口
|
||||
*
|
||||
* @author scott
|
||||
*/
|
||||
public interface IBpmBaseExtAPI {
|
||||
/**
|
||||
* 23. 流程提交接口(online,自定义开发)
|
||||
* @param flowCode 流程业务关联 例如:joa_leave_01
|
||||
* @param id 表单业务数据data id
|
||||
* @param formUrl 流程审批时附件页面默认展示的PC端表单组件(地址)
|
||||
* @param formUrlMobile 流程审批时附件页面默认展示的移动端表单组件(地址)
|
||||
* @param username 流程发起人账号
|
||||
* @param jsonData Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Result<String> startMutilProcess(String flowCode, String id, String formUrl, String formUrlMobile, String username, String jsonData) throws Exception;
|
||||
|
||||
/**
|
||||
* 24. 流程提交接口(自定义表单设计器)
|
||||
* @param flowCode 流程业务关联 例如:joa_leave_01
|
||||
* @param id 表单业务数据data id
|
||||
* @param formUrl 流程审批时附件页面默认展示的PC端表单组件(地址)
|
||||
* @param formUrlMobile 流程审批时附件页面默认展示的移动端表单组件(地址)
|
||||
* @param username 流程发起人账号
|
||||
* @param jsonData Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Result<String> startDesFormMutilProcess(String flowCode, String id, String formUrl, String formUrlMobile, String username, String jsonData) throws Exception;
|
||||
/**
|
||||
* 25. 保存流程草稿箱接口(自定义开发表单、online表单)
|
||||
* @param flowCode 流程业务关联 例如:joa_leave_01
|
||||
* @param id 表单业务数据data id
|
||||
* @param formUrl 流程审批时附件页面默认展示的PC端表单组件(地址) 【非必填】
|
||||
* @param formUrlMobile 流程审批时附件页面默认展示的移动端表单组件(地址) 【非必填】
|
||||
* @param username 流程发起人账号
|
||||
* @param jsonData Json串,额外扩展的流程变量值 【非必填】
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
Result<String> saveMutilProcessDraft(String flowCode, String id, String formUrl, String formUrlMobile, String username, String jsonData) throws Exception;
|
||||
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package org.jeecg.common.online.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.common.system.vo.DictModel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 表单设计器【Online】翻译API接口
|
||||
*
|
||||
* @author sunjianlei
|
||||
*/
|
||||
public interface IOnlineBaseExtAPI {
|
||||
|
||||
/**
|
||||
* 【Online】 表单设计器专用:同步新增
|
||||
*/
|
||||
String cgformPostCrazyForm(String tableName, JSONObject jsonObject) throws Exception;
|
||||
|
||||
/**
|
||||
* 【Online】 表单设计器专用:同步编辑
|
||||
*/
|
||||
String cgformPutCrazyForm(String tableName, JSONObject jsonObject) throws Exception;
|
||||
|
||||
/**
|
||||
* online表单删除数据
|
||||
*
|
||||
* @param cgformCode Online表单code
|
||||
* @param dataIds 数据ID,可逗号分割
|
||||
* @return
|
||||
*/
|
||||
String cgformDeleteDataByCode(String cgformCode, String dataIds);
|
||||
|
||||
/**
|
||||
* 通过online表名查询数据,同时查询出子表的数据
|
||||
*
|
||||
* @param tableName online表名
|
||||
* @param dataIds online数据ID
|
||||
* @return
|
||||
*/
|
||||
JSONObject cgformQueryAllDataByTableName(String tableName, String dataIds);
|
||||
|
||||
/**
|
||||
* 对 cgreportGetData 的返回值做优化,封装 DictModel 集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<DictModel> cgreportGetDataPackage(String code, String dictText, String dictCode, String dataList);
|
||||
|
||||
/**
|
||||
* 【cgreport】通过 head code 获取 sql语句,并执行该语句返回查询数据
|
||||
*
|
||||
* @param code 报表Code,如果没传ID就通过code查
|
||||
* @param forceKey
|
||||
* @param dataList
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> cgreportGetData(String code, String forceKey, String dataList);
|
||||
|
||||
}
|
||||
@ -80,14 +80,16 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
|
||||
|
||||
/** 11查询所有的父级字典,按照create_time排序 */
|
||||
/** 11查询所有的父级字典,按照create_time排序
|
||||
* @return List<DictModel> 字典集合
|
||||
*/
|
||||
public List<DictModel> queryAllDict();
|
||||
|
||||
/**
|
||||
* 12查询所有分类字典
|
||||
* @return
|
||||
*/
|
||||
public List<SysCategoryModel> queryAllDSysCategory();
|
||||
public List<SysCategoryModel> queryAllSysCategory();
|
||||
|
||||
|
||||
/**
|
||||
@ -132,6 +134,9 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 19分页查询用户 返回JSONObject
|
||||
* @param userIds 多个用户id
|
||||
* @param pageNo 当前页数
|
||||
* @param pageSize 每页显示条数
|
||||
* @return
|
||||
*/
|
||||
public JSONObject queryAllUser(String userIds, Integer pageNo, Integer pageSize);
|
||||
@ -144,7 +149,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 21获取所有角色 带参
|
||||
* roleIds 默认选中角色
|
||||
* @param roleIds 默认选中角色
|
||||
* @return
|
||||
*/
|
||||
public List<ComboModel> queryAllRole(String[] roleIds );
|
||||
@ -192,7 +197,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 28根据id获取所有参与用户
|
||||
* userIds
|
||||
* @param userIds 多个用户id
|
||||
* @return
|
||||
*/
|
||||
public List<LoginUser> queryAllUserByIds(String[] userIds);
|
||||
@ -207,7 +212,7 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 30根据name获取所有参与用户
|
||||
* userNames
|
||||
* @param userNames 多个用户账户
|
||||
* @return
|
||||
*/
|
||||
List<LoginUser> queryUserByNames(String[] userNames);
|
||||
@ -236,6 +241,8 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
|
||||
/**
|
||||
* 34通过部门id获取部门全部信息
|
||||
* @param id 部门id
|
||||
* @return SysDepartModel对象
|
||||
*/
|
||||
SysDepartModel selectAllById(String id);
|
||||
|
||||
@ -284,11 +291,14 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
/**
|
||||
* 41 获取公司下级部门和公司下所有用户信息
|
||||
* @param orgCode
|
||||
* @return List<Map>
|
||||
*/
|
||||
List<Map> getDeptUserByOrgCode(String orgCode);
|
||||
|
||||
/**
|
||||
* 查询分类字典翻译
|
||||
* @param ids 多个分类字典id
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> loadCategoryDictItem(String ids);
|
||||
|
||||
@ -323,8 +333,22 @@ public interface ISysBaseAPI extends CommonAPI {
|
||||
*
|
||||
* @param dictCode 字典code格式:table,text,code
|
||||
* @param keyword 过滤关键字
|
||||
* @param pageSize 分页条数
|
||||
* @return
|
||||
*/
|
||||
List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 发送模板消息
|
||||
* @param message
|
||||
*/
|
||||
void sendTemplateMessage(MessageDTO message);
|
||||
|
||||
/**
|
||||
* 根据模板编码获取模板内容
|
||||
* @param templateCode
|
||||
* @return
|
||||
*/
|
||||
String getTemplateContent(String templateCode);
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>jeecg-boot-base</artifactId>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>jeecg-boot-base</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<version>3.3.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -63,6 +63,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<!--springboot2.6+解决metrics端点不显示jvm信息的问题-->
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- commons -->
|
||||
<dependency>
|
||||
@ -101,21 +106,6 @@
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>${dynamic-datasource-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>hibernate-re</artifactId>
|
||||
<version>3.1.0-beta1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 数据库驱动 -->
|
||||
<!--mysql-->
|
||||
@ -176,6 +166,11 @@
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-core</artifactId>
|
||||
</exclusion>
|
||||
<!-- [issues/3596] 解决启动报错:Cannot resolve com.sun:tools:1.8.0 -->
|
||||
<exclusion>
|
||||
<groupId>com.puppycrawl.tools</groupId>
|
||||
<artifactId>checkstyle</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -6,6 +6,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 通用api
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface CommonAPI {
|
||||
|
||||
/**
|
||||
@ -67,6 +71,9 @@ public interface CommonAPI {
|
||||
|
||||
/**
|
||||
* 8查询数据权限
|
||||
* @param component 组件
|
||||
* @param username 用户名
|
||||
* @param requestPath 前段请求地址
|
||||
* @return
|
||||
*/
|
||||
List<SysPermissionDataRuleModel> queryPermissionDataRule(String component, String requestPath, String username);
|
||||
|
||||
@ -8,6 +8,7 @@ import java.io.Serializable;
|
||||
/**
|
||||
* 文件下载
|
||||
* cloud api 用到的接口传输对象
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class FileDownDTO implements Serializable {
|
||||
|
||||
@ -8,6 +8,7 @@ import java.io.Serializable;
|
||||
/**
|
||||
* 文件上传
|
||||
* cloud api 用到的接口传输对象
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class FileUploadDTO implements Serializable {
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Date;
|
||||
/**
|
||||
* 日志对象
|
||||
* cloud api 用到的接口传输对象
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class LogDTO implements Serializable {
|
||||
|
||||
@ -8,6 +8,7 @@ import java.util.List;
|
||||
/**
|
||||
* online 拦截器权限判断
|
||||
* cloud api 用到的接口传输对象
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class OnlineAuthDTO implements Serializable {
|
||||
|
||||
@ -6,6 +6,7 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 带业务参数的消息
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class BusMessageDTO extends MessageDTO implements Serializable {
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 带业务参数的模板消息
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class BusTemplateMessageDTO extends TemplateMessageDTO implements Serializable {
|
||||
|
||||
@ -4,9 +4,11 @@ import lombok.Data;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 普通消息
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class MessageDTO implements Serializable {
|
||||
@ -26,7 +28,7 @@ public class MessageDTO implements Serializable {
|
||||
/**
|
||||
* 发送给所有人
|
||||
*/
|
||||
protected boolean toAll;
|
||||
protected Boolean toAll;
|
||||
|
||||
/**
|
||||
* 消息主题
|
||||
@ -71,4 +73,18 @@ public class MessageDTO implements Serializable {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板消息对应的模板编码
|
||||
*/
|
||||
protected String templateCode;
|
||||
/**
|
||||
* 消息类型:org.jeecg.common.constant.enums.MessageTypeEnum
|
||||
*/
|
||||
protected String type;
|
||||
|
||||
/**
|
||||
* 解析模板内容 对应的数据
|
||||
*/
|
||||
protected Map<String, Object> data;
|
||||
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 消息模板dto
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class TemplateDTO implements Serializable {
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 模板消息
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Data
|
||||
public class TemplateMessageDTO extends TemplateDTO implements Serializable {
|
||||
|
||||
@ -58,7 +58,7 @@ public class Result<T> implements Serializable {
|
||||
* @param code
|
||||
* @param message
|
||||
*/
|
||||
public Result(Integer code,String message) {
|
||||
public Result(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
@ -70,7 +70,6 @@ public class Result<T> implements Serializable {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static<T> Result<T> ok() {
|
||||
Result<T> r = new Result<T>();
|
||||
r.setSuccess(true);
|
||||
@ -78,16 +77,16 @@ public class Result<T> implements Serializable {
|
||||
return r;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static<T> Result<T> ok(String msg) {
|
||||
Result<T> r = new Result<T>();
|
||||
r.setSuccess(true);
|
||||
r.setCode(CommonConstant.SC_OK_200);
|
||||
//Result OK(String msg)方法会造成兼容性问题 issues/I4IP3D
|
||||
r.setResult((T) msg);
|
||||
r.setMessage(msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static<T> Result<T> ok(T data) {
|
||||
Result<T> r = new Result<T>();
|
||||
r.setSuccess(true);
|
||||
@ -103,7 +102,13 @@ public class Result<T> implements Serializable {
|
||||
return r;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* 此方法是为了兼容升级所创建
|
||||
*
|
||||
* @param msg
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static<T> Result<T> OK(String msg) {
|
||||
Result<T> r = new Result<T>();
|
||||
r.setSuccess(true);
|
||||
|
||||
@ -14,9 +14,10 @@ import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.enums.ModuleType;
|
||||
import org.jeecg.common.constant.enums.OperateTypeEnum;
|
||||
import org.jeecg.modules.base.service.BaseCommonService;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.IPUtils;
|
||||
import org.jeecg.common.util.IpUtils;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||
@ -97,7 +98,7 @@ public class AutoLogAspect {
|
||||
//请求的参数
|
||||
dto.setRequestParam(getReqestParams(request,joinPoint));
|
||||
//设置IP地址
|
||||
dto.setIp(IPUtils.getIpAddr(request));
|
||||
dto.setIp(IpUtils.getIpAddr(request));
|
||||
//获取登录用户信息
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(sysUser!=null){
|
||||
@ -120,25 +121,9 @@ public class AutoLogAspect {
|
||||
if (operateType > 0) {
|
||||
return operateType;
|
||||
}
|
||||
if (methodName.startsWith("list")) {
|
||||
return CommonConstant.OPERATE_TYPE_1;
|
||||
}
|
||||
if (methodName.startsWith("add")) {
|
||||
return CommonConstant.OPERATE_TYPE_2;
|
||||
}
|
||||
if (methodName.startsWith("edit")) {
|
||||
return CommonConstant.OPERATE_TYPE_3;
|
||||
}
|
||||
if (methodName.startsWith("delete")) {
|
||||
return CommonConstant.OPERATE_TYPE_4;
|
||||
}
|
||||
if (methodName.startsWith("import")) {
|
||||
return CommonConstant.OPERATE_TYPE_5;
|
||||
}
|
||||
if (methodName.startsWith("export")) {
|
||||
return CommonConstant.OPERATE_TYPE_6;
|
||||
}
|
||||
return CommonConstant.OPERATE_TYPE_1;
|
||||
//update-begin---author:wangshuai ---date:20220331 for:阿里云代码扫描规范(不允许任何魔法值出现在代码中)------------
|
||||
return OperateTypeEnum.getTypeByMethodName(methodName);
|
||||
//update-end---author:wangshuai ---date:20220331 for:阿里云代码扫描规范(不允许任何魔法值出现在代码中)------------
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,7 +137,7 @@ public class AutoLogAspect {
|
||||
private String getReqestParams(HttpServletRequest request, JoinPoint joinPoint) {
|
||||
String httpMethod = request.getMethod();
|
||||
String params = "";
|
||||
if ("POST".equals(httpMethod) || "PUT".equals(httpMethod) || "PATCH".equals(httpMethod)) {
|
||||
if (CommonConstant.HTTP_POST.equals(httpMethod) || CommonConstant.HTTP_PUT.equals(httpMethod) || CommonConstant.HTTP_PATCH.equals(httpMethod)) {
|
||||
Object[] paramsArray = joinPoint.getArgs();
|
||||
// java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
|
||||
// https://my.oschina.net/mengzhang6/blog/2395893
|
||||
@ -169,7 +154,8 @@ public class AutoLogAspect {
|
||||
PropertyFilter profilter = new PropertyFilter() {
|
||||
@Override
|
||||
public boolean apply(Object o, String name, Object value) {
|
||||
if(value!=null && value.toString().length()>500){
|
||||
int length = 500;
|
||||
if(value!=null && value.toString().length()>length){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.parser.Feature;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -25,7 +24,6 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
@ -42,11 +40,18 @@ import java.util.stream.Collectors;
|
||||
public class DictAspect {
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CommonAPI commonAPI;
|
||||
private CommonAPI commonApi;
|
||||
@Autowired
|
||||
public RedisTemplate redisTemplate;
|
||||
|
||||
// 定义切点Pointcut
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
private static final String JAVA_UTIL_DATE = "java.util.Date";
|
||||
|
||||
/**
|
||||
* 定义切点Pointcut
|
||||
*/
|
||||
@Pointcut("execution(public * org.jeecg.modules..*.*Controller.*(..)) || @annotation(org.jeecg.common.aspect.annotation.AutoDict)")
|
||||
public void excudeService() {
|
||||
}
|
||||
@ -58,7 +63,7 @@ public class DictAspect {
|
||||
long time2=System.currentTimeMillis();
|
||||
log.debug("获取JSON数据 耗时:"+(time2-time1)+"ms");
|
||||
long start=System.currentTimeMillis();
|
||||
this.parseDictText(result);
|
||||
result=this.parseDictText(result);
|
||||
long end=System.currentTimeMillis();
|
||||
log.debug("注入字典到JSON数据 耗时"+(end-start)+"ms");
|
||||
return result;
|
||||
@ -86,7 +91,7 @@ public class DictAspect {
|
||||
* 目前vue是这么进行字典渲染到table上的多了就很麻烦了 这个直接在服务端渲染完成前端可以直接用
|
||||
* @param result
|
||||
*/
|
||||
private void parseDictText(Object result) {
|
||||
private Object parseDictText(Object result) {
|
||||
if (result instanceof Result) {
|
||||
if (((Result) result).getResult() instanceof IPage) {
|
||||
List<JSONObject> items = new ArrayList<>();
|
||||
@ -94,14 +99,24 @@ public class DictAspect {
|
||||
//step.1 筛选出加了 Dict 注解的字段列表
|
||||
List<Field> dictFieldList = new ArrayList<>();
|
||||
// 字典数据列表, key = 字典code,value=数据列表
|
||||
Map<String, List<String>> dataListMap = new HashMap<>();
|
||||
Map<String, List<String>> dataListMap = new HashMap<>(5);
|
||||
//取出结果集
|
||||
List<Object> records=((IPage) ((Result) result).getResult()).getRecords();
|
||||
//update-begin--Author:zyf -- Date:20220606 ----for:【VUEN-1230】 判断是否含有字典注解,没有注解返回-----
|
||||
Boolean hasDict= checkHasDict(records);
|
||||
if(!hasDict){
|
||||
return result;
|
||||
}
|
||||
|
||||
for (Object record : ((IPage) ((Result) result).getResult()).getRecords()) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
log.info(" __ 进入字典翻译切面 DictAspect —— " );
|
||||
//update-end--Author:zyf -- Date:20220606 ----for:【VUEN-1230】 判断是否含有字典注解,没有注解返回-----
|
||||
for (Object record : records) {
|
||||
String json="{}";
|
||||
try {
|
||||
//update-begin--Author:zyf -- Date:20220531 ----for:【issues/#3629】 DictAspect Jackson序列化报错-----
|
||||
//解决@JsonFormat注解解析不了的问题详见SysAnnouncement类的@JsonFormat
|
||||
json = mapper.writeValueAsString(record);
|
||||
json = objectMapper.writeValueAsString(record);
|
||||
//update-end--Author:zyf -- Date:20220531 ----for:【issues/#3629】 DictAspect Jackson序列化报错-----
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error("json解析失败"+e.getMessage(),e);
|
||||
}
|
||||
@ -135,10 +150,12 @@ public class DictAspect {
|
||||
this.listAddAllDeduplicate(dataList, Arrays.asList(value.split(",")));
|
||||
}
|
||||
//date类型默认转换string格式化日期
|
||||
if (field.getType().getName().equals("java.util.Date")&&field.getAnnotation(JsonFormat.class)==null&&item.get(field.getName())!=null){
|
||||
SimpleDateFormat aDate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
item.put(field.getName(), aDate.format(new Date((Long) item.get(field.getName()))));
|
||||
}
|
||||
//update-begin--Author:zyf -- Date:20220531 ----for:【issues/#3629】 DictAspect Jackson序列化报错-----
|
||||
//if (JAVA_UTIL_DATE.equals(field.getType().getName())&&field.getAnnotation(JsonFormat.class)==null&&item.get(field.getName())!=null){
|
||||
//SimpleDateFormat aDate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// item.put(field.getName(), aDate.format(new Date((Long) item.get(field.getName()))));
|
||||
//}
|
||||
//update-end--Author:zyf -- Date:20220531 ----for:【issues/#3629】 DictAspect Jackson序列化报错-----
|
||||
}
|
||||
items.add(item);
|
||||
}
|
||||
@ -184,6 +201,7 @@ public class DictAspect {
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -204,7 +222,7 @@ public class DictAspect {
|
||||
*/
|
||||
private Map<String, List<DictModel>> translateAllDict(Map<String, List<String>> dataListMap) {
|
||||
// 翻译后的字典文本,key=dictCode
|
||||
Map<String, List<DictModel>> translText = new HashMap<>();
|
||||
Map<String, List<DictModel>> translText = new HashMap<>(5);
|
||||
// 需要翻译的数据(有些可以从redis缓存中获取,就不走数据库查询)
|
||||
List<String> needTranslData = new ArrayList<>();
|
||||
//step.1 先通过redis中获取缓存字典数据
|
||||
@ -258,7 +276,7 @@ public class DictAspect {
|
||||
String values = String.join(",", needTranslDataTable);
|
||||
log.info("translateDictFromTableByKeys.dictCode:" + dictCode);
|
||||
log.info("translateDictFromTableByKeys.values:" + values);
|
||||
List<DictModel> texts = commonAPI.translateDictFromTableByKeys(table, text, code, values);
|
||||
List<DictModel> texts = commonApi.translateDictFromTableByKeys(table, text, code, values);
|
||||
log.info("translateDictFromTableByKeys.result:" + texts);
|
||||
List<DictModel> list = translText.computeIfAbsent(dictCode, k -> new ArrayList<>());
|
||||
list.addAll(texts);
|
||||
@ -287,7 +305,7 @@ public class DictAspect {
|
||||
String values = String.join(",", needTranslData);
|
||||
log.info("translateManyDict.dictCodes:" + dictCodes);
|
||||
log.info("translateManyDict.values:" + values);
|
||||
Map<String, List<DictModel>> manyDict = commonAPI.translateManyDict(dictCodes, values);
|
||||
Map<String, List<DictModel>> manyDict = commonApi.translateManyDict(dictCodes, values);
|
||||
log.info("translateManyDict.result:" + manyDict);
|
||||
for (String dictCode : manyDict.keySet()) {
|
||||
List<DictModel> list = translText.computeIfAbsent(dictCode, k -> new ArrayList<>());
|
||||
@ -365,7 +383,7 @@ public class DictAspect {
|
||||
log.warn(e.getMessage());
|
||||
}
|
||||
}else {
|
||||
tmpValue= commonAPI.translateDictFromTable(table,text,code,k.trim());
|
||||
tmpValue= commonApi.translateDictFromTable(table,text,code,k.trim());
|
||||
}
|
||||
}else {
|
||||
String keyString = String.format("sys:cache:dict::%s:%s",code,k.trim());
|
||||
@ -376,7 +394,7 @@ public class DictAspect {
|
||||
log.warn(e.getMessage());
|
||||
}
|
||||
}else {
|
||||
tmpValue = commonAPI.translateDict(code, k.trim());
|
||||
tmpValue = commonApi.translateDict(code, k.trim());
|
||||
}
|
||||
}
|
||||
//update-end--Author:scott -- Date:20210531 ----for: !56 优化微服务应用下存在表字段需要字典翻译时加载缓慢问题-----
|
||||
@ -392,4 +410,20 @@ public class DictAspect {
|
||||
return textValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测返回结果集中是否包含Dict注解
|
||||
* @param records
|
||||
* @return
|
||||
*/
|
||||
private Boolean checkHasDict(List<Object> records){
|
||||
if(oConvertUtils.isNotEmpty(records) && records.size()>0){
|
||||
for (Field field : oConvertUtils.getAllFields(records.get(0))) {
|
||||
if (oConvertUtils.isNotEmpty(field.getAnnotation(Dict.class))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,6 +9,8 @@ import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.aspect.annotation.PermissionData;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.system.util.JeecgDataAutorUtils;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.SysPermissionDataRuleModel;
|
||||
@ -28,6 +30,7 @@ import java.util.List;
|
||||
* 当被请求的方法有注解PermissionData时,会在往当前request中写入数据权限信息
|
||||
* @Date 2019年4月10日
|
||||
* @Version: 1.0
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
@ -35,7 +38,9 @@ import java.util.List;
|
||||
public class PermissionDataAspect {
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CommonAPI commonAPI;
|
||||
private CommonAPI commonApi;
|
||||
|
||||
private static final String SPOT_DO = ".do";
|
||||
|
||||
@Pointcut("@annotation(org.jeecg.common.aspect.annotation.PermissionData)")
|
||||
public void pointCut() {
|
||||
@ -55,7 +60,7 @@ public class PermissionDataAspect {
|
||||
//update-begin-author:taoyan date:20211027 for:JTC-132【online报表权限】online报表带参数的菜单配置数据权限无效
|
||||
//先判断是否online报表请求
|
||||
// TODO 参数顺序调整有隐患
|
||||
if(requestPath.indexOf(UrlMatchEnum.CGREPORT_DATA.getMatch_url())>=0){
|
||||
if(requestPath.indexOf(UrlMatchEnum.CGREPORT_DATA.getMatchUrl())>=0){
|
||||
// 获取地址栏参数
|
||||
String urlParamString = request.getParameter(CommonConstant.ONL_REP_URL_PARAM_STR);
|
||||
if(oConvertUtils.isNotEmpty(urlParamString)){
|
||||
@ -67,12 +72,12 @@ public class PermissionDataAspect {
|
||||
String username = JwtUtil.getUserNameByToken(request);
|
||||
//查询数据权限信息
|
||||
//TODO 微服务情况下也得支持缓存机制
|
||||
List<SysPermissionDataRuleModel> dataRules = commonAPI.queryPermissionDataRule(component, requestPath, username);
|
||||
List<SysPermissionDataRuleModel> dataRules = commonApi.queryPermissionDataRule(component, requestPath, username);
|
||||
if(dataRules!=null && dataRules.size()>0) {
|
||||
//临时存储
|
||||
JeecgDataAutorUtils.installDataSearchConditon(request, dataRules);
|
||||
//TODO 微服务情况下也得支持缓存机制
|
||||
SysUserCacheInfo userinfo = commonAPI.getCacheUser(username);
|
||||
SysUserCacheInfo userinfo = commonApi.getCacheUser(username);
|
||||
JeecgDataAutorUtils.installUserInfo(request, userinfo);
|
||||
}
|
||||
return point.proceed();
|
||||
@ -83,7 +88,7 @@ public class PermissionDataAspect {
|
||||
if(oConvertUtils.isNotEmpty(requestPath)){
|
||||
url = requestPath.replace("\\", "/");
|
||||
url = url.replace("//", "/");
|
||||
if(url.indexOf("//")>=0){
|
||||
if(url.indexOf(SymbolConstant.DOUBLE_SLASH)>=0){
|
||||
url = filterUrl(url);
|
||||
}
|
||||
/*if(url.startsWith("/")){
|
||||
@ -105,17 +110,19 @@ public class PermissionDataAspect {
|
||||
if(oConvertUtils.isNotEmpty(queryString)){
|
||||
requestPath += "?" + queryString;
|
||||
}
|
||||
if (requestPath.indexOf("&") > -1) {// 去掉其他参数(保留一个参数) 例如:loginController.do?login
|
||||
// 去掉其他参数(保留一个参数) 例如:loginController.do?login
|
||||
if (requestPath.indexOf(SymbolConstant.AND) > -1) {
|
||||
requestPath = requestPath.substring(0, requestPath.indexOf("&"));
|
||||
}
|
||||
if(requestPath.indexOf("=")!=-1){
|
||||
if(requestPath.indexOf(".do")!=-1){
|
||||
if(requestPath.indexOf(QueryRuleEnum.EQ.getValue())!=-1){
|
||||
if(requestPath.indexOf(SPOT_DO)!=-1){
|
||||
requestPath = requestPath.substring(0,requestPath.indexOf(".do")+3);
|
||||
}else{
|
||||
requestPath = requestPath.substring(0,requestPath.indexOf("?"));
|
||||
}
|
||||
}
|
||||
requestPath = requestPath.substring(request.getContextPath().length() + 1);// 去掉项目路径
|
||||
// 去掉项目路径
|
||||
requestPath = requestPath.substring(request.getContextPath().length() + 1);
|
||||
return filterUrl(requestPath);
|
||||
}
|
||||
|
||||
|
||||
@ -6,16 +6,22 @@ package org.jeecg.common.aspect;
|
||||
* @Description: 请求URL与菜单路由URL转换规则(方便于采用菜单路由URL来配置数据权限规则)
|
||||
*/
|
||||
public enum UrlMatchEnum {
|
||||
/**求URL与菜单路由URL转换规则 /online/cgform/api/getData/ */
|
||||
CGFORM_DATA("/online/cgform/api/getData/", "/online/cgformList/"),
|
||||
/**求URL与菜单路由URL转换规则 /online/cgform/api/exportXls/ */
|
||||
CGFORM_EXCEL_DATA("/online/cgform/api/exportXls/", "/online/cgformList/"),
|
||||
/**求URL与菜单路由URL转换规则 /online/cgform/api/getTreeData/ */
|
||||
CGFORM_TREE_DATA("/online/cgform/api/getTreeData/", "/online/cgformList/"),
|
||||
/**求URL与菜单路由URL转换规则 /online/cgreport/api/getColumnsAndData/ */
|
||||
CGREPORT_DATA("/online/cgreport/api/getColumnsAndData/", "/online/cgreport/"),
|
||||
/**求URL与菜单路由URL转换规则 /online/cgreport/api/exportXls/ */
|
||||
CGREPORT_EXCEL_DATA("/online/cgreport/api/exportXls/", "/online/cgreport/"),
|
||||
/**求URL与菜单路由URL转换规则 /online/cgreport/api/exportManySheetXls/ */
|
||||
CGREPORT_EXCEL_DATA2("/online/cgreport/api/exportManySheetXls/", "/online/cgreport/");
|
||||
|
||||
UrlMatchEnum(String url, String match_url) {
|
||||
UrlMatchEnum(String url, String matchUrl) {
|
||||
this.url = url;
|
||||
this.match_url = match_url;
|
||||
this.matchUrl = matchUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -25,7 +31,7 @@ public enum UrlMatchEnum {
|
||||
/**
|
||||
* 菜单路由 URL前缀 (对应菜单路径)
|
||||
*/
|
||||
private String match_url;
|
||||
private String matchUrl;
|
||||
|
||||
/**
|
||||
* 根据req url 获取到菜单配置路径(前端页面路由URL)
|
||||
@ -41,14 +47,14 @@ public enum UrlMatchEnum {
|
||||
//如果遍历获取的type和参数type一致
|
||||
if (url.indexOf(lr.url) != -1) {
|
||||
//返回type对象的desc
|
||||
return url.replace(lr.url, lr.match_url);
|
||||
return url.replace(lr.url, lr.matchUrl);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getMatch_url() {
|
||||
return match_url;
|
||||
public String getMatchUrl() {
|
||||
return matchUrl;
|
||||
}
|
||||
// public static void main(String[] args) {
|
||||
// /**
|
||||
|
||||
@ -6,9 +6,9 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 类描述: 字典注解
|
||||
* 作 者: dangzhenghui
|
||||
* 日 期: 2019年03月17日-下午9:37:16
|
||||
* 字典注解
|
||||
* @author: dangzhenghui
|
||||
* @date: 2019年03月17日-下午9:37:16
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package org.jeecg.common.aspect.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 动态table切换
|
||||
*
|
||||
* @author :zyf
|
||||
* @date:2020-04-25
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface DynamicTable {
|
||||
/**
|
||||
* 需要动态解析的表名
|
||||
* @return
|
||||
*/
|
||||
String value();
|
||||
}
|
||||
@ -4,6 +4,7 @@ import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* online请求拦截专用注解
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE,ElementType.METHOD})
|
||||
|
||||
@ -1,324 +1,329 @@
|
||||
package org.jeecg.common.constant;
|
||||
|
||||
/**
|
||||
* @Description: 通用常量
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface CommonConstant {
|
||||
|
||||
/**
|
||||
* 正常状态
|
||||
*/
|
||||
public static final Integer STATUS_NORMAL = 0;
|
||||
Integer STATUS_NORMAL = 0;
|
||||
|
||||
/**
|
||||
* 禁用状态
|
||||
*/
|
||||
public static final Integer STATUS_DISABLE = -1;
|
||||
Integer STATUS_DISABLE = -1;
|
||||
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
public static final Integer DEL_FLAG_1 = 1;
|
||||
Integer DEL_FLAG_1 = 1;
|
||||
|
||||
/**
|
||||
* 未删除
|
||||
*/
|
||||
public static final Integer DEL_FLAG_0 = 0;
|
||||
Integer DEL_FLAG_0 = 0;
|
||||
|
||||
/**
|
||||
* 系统日志类型: 登录
|
||||
*/
|
||||
public static final int LOG_TYPE_1 = 1;
|
||||
int LOG_TYPE_1 = 1;
|
||||
|
||||
/**
|
||||
* 系统日志类型: 操作
|
||||
*/
|
||||
public static final int LOG_TYPE_2 = 2;
|
||||
int LOG_TYPE_2 = 2;
|
||||
|
||||
/**
|
||||
* 操作日志类型: 查询
|
||||
*/
|
||||
public static final int OPERATE_TYPE_1 = 1;
|
||||
int OPERATE_TYPE_1 = 1;
|
||||
|
||||
/**
|
||||
* 操作日志类型: 添加
|
||||
*/
|
||||
public static final int OPERATE_TYPE_2 = 2;
|
||||
int OPERATE_TYPE_2 = 2;
|
||||
|
||||
/**
|
||||
* 操作日志类型: 更新
|
||||
*/
|
||||
public static final int OPERATE_TYPE_3 = 3;
|
||||
int OPERATE_TYPE_3 = 3;
|
||||
|
||||
/**
|
||||
* 操作日志类型: 删除
|
||||
*/
|
||||
public static final int OPERATE_TYPE_4 = 4;
|
||||
int OPERATE_TYPE_4 = 4;
|
||||
|
||||
/**
|
||||
* 操作日志类型: 倒入
|
||||
*/
|
||||
public static final int OPERATE_TYPE_5 = 5;
|
||||
int OPERATE_TYPE_5 = 5;
|
||||
|
||||
/**
|
||||
* 操作日志类型: 导出
|
||||
*/
|
||||
public static final int OPERATE_TYPE_6 = 6;
|
||||
int OPERATE_TYPE_6 = 6;
|
||||
|
||||
|
||||
/** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
|
||||
public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
|
||||
Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
|
||||
/** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
|
||||
public static final Integer SC_OK_200 = 200;
|
||||
Integer SC_OK_200 = 200;
|
||||
|
||||
/**访问权限认证未通过 510*/
|
||||
public static final Integer SC_JEECG_NO_AUTHZ=510;
|
||||
Integer SC_JEECG_NO_AUTHZ=510;
|
||||
|
||||
/** 登录用户Shiro权限缓存KEY前缀 */
|
||||
public static String PREFIX_USER_SHIRO_CACHE = "shiro:cache:org.jeecg.config.shiro.ShiroRealm.authorizationCache:";
|
||||
/** 登录用户Token令牌缓存KEY前缀 */
|
||||
public static final String PREFIX_USER_TOKEN = "prefix_user_token_";
|
||||
/** Token缓存时间:3600秒即一小时 */
|
||||
public static final int TOKEN_EXPIRE_TIME = 3600;
|
||||
String PREFIX_USER_TOKEN = "prefix_user_token_";
|
||||
// /** Token缓存时间:3600秒即一小时 */
|
||||
// int TOKEN_EXPIRE_TIME = 3600;
|
||||
|
||||
/** 登录二维码 */
|
||||
public static final String LOGIN_QRCODE_PRE = "QRCODELOGIN:";
|
||||
public static final String LOGIN_QRCODE = "LQ:";
|
||||
String LOGIN_QRCODE_PRE = "QRCODELOGIN:";
|
||||
String LOGIN_QRCODE = "LQ:";
|
||||
/** 登录二维码token */
|
||||
public static final String LOGIN_QRCODE_TOKEN = "LQT:";
|
||||
String LOGIN_QRCODE_TOKEN = "LQT:";
|
||||
|
||||
|
||||
/**
|
||||
* 0:一级菜单
|
||||
*/
|
||||
public static final Integer MENU_TYPE_0 = 0;
|
||||
Integer MENU_TYPE_0 = 0;
|
||||
/**
|
||||
* 1:子菜单
|
||||
*/
|
||||
public static final Integer MENU_TYPE_1 = 1;
|
||||
Integer MENU_TYPE_1 = 1;
|
||||
/**
|
||||
* 2:按钮权限
|
||||
*/
|
||||
public static final Integer MENU_TYPE_2 = 2;
|
||||
Integer MENU_TYPE_2 = 2;
|
||||
|
||||
/**通告对象类型(USER:指定用户,ALL:全体用户)*/
|
||||
public static final String MSG_TYPE_UESR = "USER";
|
||||
public static final String MSG_TYPE_ALL = "ALL";
|
||||
String MSG_TYPE_UESR = "USER";
|
||||
String MSG_TYPE_ALL = "ALL";
|
||||
|
||||
/**发布状态(0未发布,1已发布,2已撤销)*/
|
||||
public static final String NO_SEND = "0";
|
||||
public static final String HAS_SEND = "1";
|
||||
public static final String HAS_CANCLE = "2";
|
||||
String NO_SEND = "0";
|
||||
String HAS_SEND = "1";
|
||||
String HAS_CANCLE = "2";
|
||||
|
||||
/**阅读状态(0未读,1已读)*/
|
||||
public static final String HAS_READ_FLAG = "1";
|
||||
public static final String NO_READ_FLAG = "0";
|
||||
String HAS_READ_FLAG = "1";
|
||||
String NO_READ_FLAG = "0";
|
||||
|
||||
/**优先级(L低,M中,H高)*/
|
||||
public static final String PRIORITY_L = "L";
|
||||
public static final String PRIORITY_M = "M";
|
||||
public static final String PRIORITY_H = "H";
|
||||
String PRIORITY_L = "L";
|
||||
String PRIORITY_M = "M";
|
||||
String PRIORITY_H = "H";
|
||||
|
||||
/**
|
||||
* 短信模板方式 0 .登录模板、1.注册模板、2.忘记密码模板
|
||||
*/
|
||||
public static final String SMS_TPL_TYPE_0 = "0";
|
||||
public static final String SMS_TPL_TYPE_1 = "1";
|
||||
public static final String SMS_TPL_TYPE_2 = "2";
|
||||
String SMS_TPL_TYPE_0 = "0";
|
||||
String SMS_TPL_TYPE_1 = "1";
|
||||
String SMS_TPL_TYPE_2 = "2";
|
||||
|
||||
/**
|
||||
* 状态(0无效1有效)
|
||||
*/
|
||||
public static final String STATUS_0 = "0";
|
||||
public static final String STATUS_1 = "1";
|
||||
String STATUS_0 = "0";
|
||||
String STATUS_1 = "1";
|
||||
|
||||
/**
|
||||
* 同步工作流引擎1同步0不同步
|
||||
*/
|
||||
public static final Integer ACT_SYNC_1 = 1;
|
||||
public static final Integer ACT_SYNC_0 = 0;
|
||||
Integer ACT_SYNC_1 = 1;
|
||||
Integer ACT_SYNC_0 = 0;
|
||||
|
||||
/**
|
||||
* 消息类型1:通知公告2:系统消息
|
||||
*/
|
||||
public static final String MSG_CATEGORY_1 = "1";
|
||||
public static final String MSG_CATEGORY_2 = "2";
|
||||
String MSG_CATEGORY_1 = "1";
|
||||
String MSG_CATEGORY_2 = "2";
|
||||
|
||||
/**
|
||||
* 是否配置菜单的数据权限 1是0否
|
||||
*/
|
||||
public static final Integer RULE_FLAG_0 = 0;
|
||||
public static final Integer RULE_FLAG_1 = 1;
|
||||
Integer RULE_FLAG_0 = 0;
|
||||
Integer RULE_FLAG_1 = 1;
|
||||
|
||||
/**
|
||||
* 是否用户已被冻结 1正常(解冻) 2冻结
|
||||
*/
|
||||
public static final Integer USER_UNFREEZE = 1;
|
||||
public static final Integer USER_FREEZE = 2;
|
||||
Integer USER_UNFREEZE = 1;
|
||||
Integer USER_FREEZE = 2;
|
||||
|
||||
/**字典翻译文本后缀*/
|
||||
public static final String DICT_TEXT_SUFFIX = "_dictText";
|
||||
String DICT_TEXT_SUFFIX = "_dictText";
|
||||
|
||||
/**
|
||||
* 表单设计器主表类型
|
||||
*/
|
||||
public static final Integer DESIGN_FORM_TYPE_MAIN = 1;
|
||||
Integer DESIGN_FORM_TYPE_MAIN = 1;
|
||||
|
||||
/**
|
||||
* 表单设计器子表表类型
|
||||
*/
|
||||
public static final Integer DESIGN_FORM_TYPE_SUB = 2;
|
||||
Integer DESIGN_FORM_TYPE_SUB = 2;
|
||||
|
||||
/**
|
||||
* 表单设计器URL授权通过
|
||||
*/
|
||||
public static final Integer DESIGN_FORM_URL_STATUS_PASSED = 1;
|
||||
Integer DESIGN_FORM_URL_STATUS_PASSED = 1;
|
||||
|
||||
/**
|
||||
* 表单设计器URL授权未通过
|
||||
*/
|
||||
public static final Integer DESIGN_FORM_URL_STATUS_NOT_PASSED = 2;
|
||||
Integer DESIGN_FORM_URL_STATUS_NOT_PASSED = 2;
|
||||
|
||||
/**
|
||||
* 表单设计器新增 Flag
|
||||
*/
|
||||
public static final String DESIGN_FORM_URL_TYPE_ADD = "add";
|
||||
String DESIGN_FORM_URL_TYPE_ADD = "add";
|
||||
/**
|
||||
* 表单设计器修改 Flag
|
||||
*/
|
||||
public static final String DESIGN_FORM_URL_TYPE_EDIT = "edit";
|
||||
String DESIGN_FORM_URL_TYPE_EDIT = "edit";
|
||||
/**
|
||||
* 表单设计器详情 Flag
|
||||
*/
|
||||
public static final String DESIGN_FORM_URL_TYPE_DETAIL = "detail";
|
||||
String DESIGN_FORM_URL_TYPE_DETAIL = "detail";
|
||||
/**
|
||||
* 表单设计器复用数据 Flag
|
||||
*/
|
||||
public static final String DESIGN_FORM_URL_TYPE_REUSE = "reuse";
|
||||
String DESIGN_FORM_URL_TYPE_REUSE = "reuse";
|
||||
/**
|
||||
* 表单设计器编辑 Flag (已弃用)
|
||||
*/
|
||||
public static final String DESIGN_FORM_URL_TYPE_VIEW = "view";
|
||||
String DESIGN_FORM_URL_TYPE_VIEW = "view";
|
||||
|
||||
/**
|
||||
* online参数值设置(是:Y, 否:N)
|
||||
*/
|
||||
public static final String ONLINE_PARAM_VAL_IS_TURE = "Y";
|
||||
public static final String ONLINE_PARAM_VAL_IS_FALSE = "N";
|
||||
String ONLINE_PARAM_VAL_IS_TURE = "Y";
|
||||
String ONLINE_PARAM_VAL_IS_FALSE = "N";
|
||||
|
||||
/**
|
||||
* 文件上传类型(本地:local,Minio:minio,阿里云:alioss)
|
||||
*/
|
||||
public static final String UPLOAD_TYPE_LOCAL = "local";
|
||||
public static final String UPLOAD_TYPE_MINIO = "minio";
|
||||
public static final String UPLOAD_TYPE_OSS = "alioss";
|
||||
String UPLOAD_TYPE_LOCAL = "local";
|
||||
String UPLOAD_TYPE_MINIO = "minio";
|
||||
String UPLOAD_TYPE_OSS = "alioss";
|
||||
|
||||
/**
|
||||
* 文档上传自定义桶名称
|
||||
*/
|
||||
public static final String UPLOAD_CUSTOM_BUCKET = "eoafile";
|
||||
String UPLOAD_CUSTOM_BUCKET = "eoafile";
|
||||
/**
|
||||
* 文档上传自定义路径
|
||||
*/
|
||||
public static final String UPLOAD_CUSTOM_PATH = "eoafile";
|
||||
String UPLOAD_CUSTOM_PATH = "eoafile";
|
||||
/**
|
||||
* 文件外链接有效天数
|
||||
*/
|
||||
public static final Integer UPLOAD_EFFECTIVE_DAYS = 1;
|
||||
Integer UPLOAD_EFFECTIVE_DAYS = 1;
|
||||
|
||||
/**
|
||||
* 员工身份 (1:普通员工 2:上级)
|
||||
*/
|
||||
public static final Integer USER_IDENTITY_1 = 1;
|
||||
public static final Integer USER_IDENTITY_2 = 2;
|
||||
Integer USER_IDENTITY_1 = 1;
|
||||
Integer USER_IDENTITY_2 = 2;
|
||||
|
||||
/** sys_user 表 username 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_SYS_USER_USERNAME = "uniq_sys_user_username";
|
||||
String SQL_INDEX_UNIQ_SYS_USER_USERNAME = "uniq_sys_user_username";
|
||||
/** sys_user 表 work_no 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_SYS_USER_WORK_NO = "uniq_sys_user_work_no";
|
||||
String SQL_INDEX_UNIQ_SYS_USER_WORK_NO = "uniq_sys_user_work_no";
|
||||
/** sys_user 表 phone 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_SYS_USER_PHONE = "uniq_sys_user_phone";
|
||||
String SQL_INDEX_UNIQ_SYS_USER_PHONE = "uniq_sys_user_phone";
|
||||
/** 达梦数据库升提示。违反表[SYS_USER]唯一性约束 */
|
||||
public static final String SQL_INDEX_UNIQ_SYS_USER = "唯一性约束";
|
||||
String SQL_INDEX_UNIQ_SYS_USER = "唯一性约束";
|
||||
|
||||
/** sys_user 表 email 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_SYS_USER_EMAIL = "uniq_sys_user_email";
|
||||
String SQL_INDEX_UNIQ_SYS_USER_EMAIL = "uniq_sys_user_email";
|
||||
/** sys_quartz_job 表 job_class_name 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_JOB_CLASS_NAME = "uniq_job_class_name";
|
||||
String SQL_INDEX_UNIQ_JOB_CLASS_NAME = "uniq_job_class_name";
|
||||
/** sys_position 表 code 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_CODE = "uniq_code";
|
||||
String SQL_INDEX_UNIQ_CODE = "uniq_code";
|
||||
/** sys_role 表 code 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_SYS_ROLE_CODE = "uniq_sys_role_role_code";
|
||||
String SQL_INDEX_UNIQ_SYS_ROLE_CODE = "uniq_sys_role_role_code";
|
||||
/** sys_depart 表 code 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_DEPART_ORG_CODE = "uniq_depart_org_code";
|
||||
String SQL_INDEX_UNIQ_DEPART_ORG_CODE = "uniq_depart_org_code";
|
||||
/** sys_category 表 code 唯一键索引 */
|
||||
public static final String SQL_INDEX_UNIQ_CATEGORY_CODE = "idx_sc_code";
|
||||
String SQL_INDEX_UNIQ_CATEGORY_CODE = "idx_sc_code";
|
||||
/**
|
||||
* 在线聊天 是否为默认分组
|
||||
*/
|
||||
public static final String IM_DEFAULT_GROUP = "1";
|
||||
String IM_DEFAULT_GROUP = "1";
|
||||
/**
|
||||
* 在线聊天 图片文件保存路径
|
||||
*/
|
||||
public static final String IM_UPLOAD_CUSTOM_PATH = "imfile";
|
||||
String IM_UPLOAD_CUSTOM_PATH = "imfile";
|
||||
/**
|
||||
* 在线聊天 用户状态
|
||||
*/
|
||||
public static final String IM_STATUS_ONLINE = "online";
|
||||
String IM_STATUS_ONLINE = "online";
|
||||
|
||||
/**
|
||||
* 在线聊天 SOCKET消息类型
|
||||
*/
|
||||
public static final String IM_SOCKET_TYPE = "chatMessage";
|
||||
String IM_SOCKET_TYPE = "chatMessage";
|
||||
|
||||
/**
|
||||
* 在线聊天 是否开启默认添加好友 1是 0否
|
||||
*/
|
||||
public static final String IM_DEFAULT_ADD_FRIEND = "1";
|
||||
String IM_DEFAULT_ADD_FRIEND = "1";
|
||||
|
||||
/**
|
||||
* 在线聊天 用户好友缓存前缀
|
||||
*/
|
||||
public static final String IM_PREFIX_USER_FRIEND_CACHE = "sys:cache:im:im_prefix_user_friend_";
|
||||
String IM_PREFIX_USER_FRIEND_CACHE = "sys:cache:im:im_prefix_user_friend_";
|
||||
|
||||
/**
|
||||
* 考勤补卡业务状态 (1:同意 2:不同意)
|
||||
*/
|
||||
public static final String SIGN_PATCH_BIZ_STATUS_1 = "1";
|
||||
public static final String SIGN_PATCH_BIZ_STATUS_2 = "2";
|
||||
String SIGN_PATCH_BIZ_STATUS_1 = "1";
|
||||
String SIGN_PATCH_BIZ_STATUS_2 = "2";
|
||||
|
||||
/**
|
||||
* 公文文档上传自定义路径
|
||||
*/
|
||||
public static final String UPLOAD_CUSTOM_PATH_OFFICIAL = "officialdoc";
|
||||
String UPLOAD_CUSTOM_PATH_OFFICIAL = "officialdoc";
|
||||
/**
|
||||
* 公文文档下载自定义路径
|
||||
*/
|
||||
public static final String DOWNLOAD_CUSTOM_PATH_OFFICIAL = "officaldown";
|
||||
String DOWNLOAD_CUSTOM_PATH_OFFICIAL = "officaldown";
|
||||
|
||||
/**
|
||||
* WPS存储值类别(1 code文号 2 text(WPS模板还是公文发文模板))
|
||||
*/
|
||||
public static final String WPS_TYPE_1="1";
|
||||
public static final String WPS_TYPE_2="2";
|
||||
String WPS_TYPE_1="1";
|
||||
String WPS_TYPE_2="2";
|
||||
|
||||
|
||||
public final static String X_ACCESS_TOKEN = "X-Access-Token";
|
||||
public final static String X_SIGN = "X-Sign";
|
||||
public final static String X_TIMESTAMP = "X-TIMESTAMP";
|
||||
public final static String TOKEN_IS_INVALID_MSG = "Token失效,请重新登录!";
|
||||
String X_ACCESS_TOKEN = "X-Access-Token";
|
||||
String X_SIGN = "X-Sign";
|
||||
String X_TIMESTAMP = "X-TIMESTAMP";
|
||||
String TOKEN_IS_INVALID_MSG = "Token失效,请重新登录!";
|
||||
String X_FORWARDED_SCHEME = "X-Forwarded-Scheme";
|
||||
|
||||
/**
|
||||
* 多租户 请求头
|
||||
*/
|
||||
public final static String TENANT_ID = "tenant-id";
|
||||
String TENANT_ID = "tenant-id";
|
||||
|
||||
/**
|
||||
* 微服务读取配置文件属性 服务地址
|
||||
*/
|
||||
public final static String CLOUD_SERVER_KEY = "spring.cloud.nacos.discovery.server-addr";
|
||||
String CLOUD_SERVER_KEY = "spring.cloud.nacos.discovery.server-addr";
|
||||
|
||||
/**
|
||||
* 第三方登录 验证密码/创建用户 都需要设置一个操作码 防止被恶意调用
|
||||
*/
|
||||
public final static String THIRD_LOGIN_CODE = "third_login_code";
|
||||
String THIRD_LOGIN_CODE = "third_login_code";
|
||||
|
||||
/**
|
||||
* 第三方APP同步方向:本地 --> 第三方APP
|
||||
@ -339,4 +344,61 @@ public interface CommonConstant {
|
||||
/**ONLINE 报表权限用 从request中获取地址栏后的参数*/
|
||||
String ONL_REP_URL_PARAM_STR="onlRepUrlParamStr";
|
||||
|
||||
/**POST请求*/
|
||||
String HTTP_POST = "POST";
|
||||
|
||||
/**PUT请求*/
|
||||
String HTTP_PUT = "PUT";
|
||||
|
||||
/**PATCH请求*/
|
||||
String HTTP_PATCH = "PATCH";
|
||||
|
||||
/**未知的*/
|
||||
String UNKNOWN = "unknown";
|
||||
|
||||
/**字符串http*/
|
||||
String STR_HTTP = "http";
|
||||
|
||||
/**String 类型的空值*/
|
||||
String STRING_NULL = "null";
|
||||
|
||||
/**前端vue3版本Header参数名*/
|
||||
String VERSION="X-Version";
|
||||
|
||||
/**存储在线程变量里的动态表名*/
|
||||
String DYNAMIC_TABLE_NAME="DYNAMIC_TABLE_NAME";
|
||||
/**
|
||||
* http:// http协议
|
||||
*/
|
||||
String HTTP_PROTOCOL = "http://";
|
||||
|
||||
/**
|
||||
* https:// https协议
|
||||
*/
|
||||
String HTTPS_PROTOCOL = "https://";
|
||||
|
||||
/** 部门表唯一key,id */
|
||||
String DEPART_KEY_ID = "id";
|
||||
/** 部门表唯一key,orgCode */
|
||||
String DEPART_KEY_ORG_CODE = "orgCode";
|
||||
|
||||
/**
|
||||
* 发消息 会传递一些信息到map
|
||||
*/
|
||||
String NOTICE_MSG_SUMMARY = "NOTICE_MSG_SUMMARY";
|
||||
|
||||
/**
|
||||
* 发消息 会传递一个业务ID到map
|
||||
*/
|
||||
String NOTICE_MSG_BUS_ID = "NOTICE_MSG_BUS_ID";
|
||||
|
||||
/**
|
||||
* 邮箱消息中地址登录时地址后携带的token,需要替换成真实的token值
|
||||
*/
|
||||
String LOGIN_TOKEN = "{LOGIN_TOKEN}";
|
||||
|
||||
/**
|
||||
* 模板消息中 跳转地址的对应的key
|
||||
*/
|
||||
String MSG_HREF_URL = "url";
|
||||
}
|
||||
|
||||
@ -7,14 +7,25 @@ package org.jeecg.common.constant;
|
||||
*/
|
||||
public interface CommonSendStatus {
|
||||
|
||||
public static final String UNPUBLISHED_STATUS_0 = "0"; //未发布
|
||||
/**
|
||||
* 未发布
|
||||
*/
|
||||
public static final String UNPUBLISHED_STATUS_0 = "0";
|
||||
|
||||
public static final String PUBLISHED_STATUS_1 = "1"; //已发布
|
||||
/**
|
||||
* 已发布
|
||||
*/
|
||||
public static final String PUBLISHED_STATUS_1 = "1";
|
||||
|
||||
public static final String REVOKE_STATUS_2 = "2"; //撤销
|
||||
//app端推送会话标识后缀
|
||||
public static final String APP_SESSION_SUFFIX = "_app"; //app端推送会话标识后缀
|
||||
/**
|
||||
* 撤销
|
||||
*/
|
||||
public static final String REVOKE_STATUS_2 = "2";
|
||||
|
||||
/**
|
||||
* app端推送会话标识后缀
|
||||
*/
|
||||
public static final String APP_SESSION_SUFFIX = "_app";
|
||||
|
||||
|
||||
/**流程催办——系统通知消息模板*/
|
||||
|
||||
@ -1,16 +1,33 @@
|
||||
package org.jeecg.common.constant;
|
||||
/**
|
||||
* 数据库上下文常量
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public interface DataBaseConstant {
|
||||
//*********数据库类型****************************************
|
||||
|
||||
/**MYSQL数据库*/
|
||||
public static final String DB_TYPE_MYSQL = "MYSQL";
|
||||
|
||||
/** ORACLE*/
|
||||
public static final String DB_TYPE_ORACLE = "ORACLE";
|
||||
public static final String DB_TYPE_DM = "DM";//达梦数据库
|
||||
|
||||
/**达梦数据库*/
|
||||
public static final String DB_TYPE_DM = "DM";
|
||||
|
||||
/**postgreSQL达梦数据库*/
|
||||
public static final String DB_TYPE_POSTGRESQL = "POSTGRESQL";
|
||||
|
||||
/**sqlserver数据库*/
|
||||
public static final String DB_TYPE_SQLSERVER = "SQLSERVER";
|
||||
|
||||
/**mariadb 数据库*/
|
||||
public static final String DB_TYPE_MARIADB = "MARIADB";
|
||||
|
||||
/**DB2 数据库*/
|
||||
public static final String DB_TYPE_DB2 = "DB2";
|
||||
|
||||
/**HSQL 数据库*/
|
||||
public static final String DB_TYPE_HSQL = "HSQL";
|
||||
|
||||
// // 数据库类型,对应 database_type 字典
|
||||
@ -131,4 +148,19 @@ public interface DataBaseConstant {
|
||||
* 租户ID 数据库字段名
|
||||
*/
|
||||
String TENANT_ID_TABLE = "tenant_id";
|
||||
|
||||
/**
|
||||
* sql语句 where
|
||||
*/
|
||||
String SQL_WHERE = "where";
|
||||
|
||||
/**
|
||||
* sql语句 asc
|
||||
*/
|
||||
String SQL_ASC = "asc";
|
||||
|
||||
/**
|
||||
* sqlserver数据库,中间有空格
|
||||
*/
|
||||
String DB_TYPE_SQL_SERVER_BLANK = "sql server";
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package org.jeecg.common.constant;
|
||||
|
||||
/**
|
||||
* 动态切换表配置常量
|
||||
*
|
||||
* @author: scott
|
||||
* @date: 2022年04月25日 22:30
|
||||
*/
|
||||
public class DynamicTableConstant {
|
||||
/**
|
||||
* 角色首页配置表
|
||||
* vue2表名: sys_role_index
|
||||
* vue3表名: sys_role_index_vue3
|
||||
*/
|
||||
public static final String SYS_ROLE_INDEX = "sys_role_index";
|
||||
}
|
||||
@ -13,6 +13,10 @@ import java.util.Scanner;
|
||||
import java.util.Set;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 省市区
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
@Component("pca")
|
||||
public class ProvinceCityArea {
|
||||
List<Area> areaList;
|
||||
@ -31,9 +35,13 @@ public class ProvinceCityArea {
|
||||
this.initAreaList();
|
||||
if(areaList!=null && areaList.size()>0){
|
||||
for(int i=areaList.size()-1;i>=0;i--){
|
||||
if(text.indexOf(areaList.get(i).getText())>=0){
|
||||
//update-begin-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
|
||||
String areaText = areaList.get(i).getText();
|
||||
String cityText = areaList.get(i).getAheadText();
|
||||
if(text.indexOf(areaText)>=0 && (cityText!=null && text.indexOf(cityText)>=0)){
|
||||
return areaList.get(i).getId();
|
||||
}
|
||||
//update-end-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@ -141,6 +149,9 @@ public class ProvinceCityArea {
|
||||
for(String areaKey:areaJson.keySet()){
|
||||
//System.out.println("········"+areaKey);
|
||||
Area area = new Area(areaKey,areaJson.getString(areaKey),cityKey);
|
||||
//update-begin-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
|
||||
area.setAheadText(cityJson.getString(cityKey));
|
||||
//update-end-author:taoyan date:2022-5-24 for:VUEN-1088 online 导入 省市区导入后 导入数据错乱 北京市/市辖区/西城区-->山西省/晋城市/城区
|
||||
this.areaList.add(area);
|
||||
}
|
||||
}
|
||||
@ -176,6 +187,8 @@ public class ProvinceCityArea {
|
||||
String id;
|
||||
String text;
|
||||
String pid;
|
||||
// 用于存储上级文本数据,区的上级文本 是市的数据
|
||||
String aheadText;
|
||||
|
||||
public Area(String id,String text,String pid){
|
||||
this.id = id;
|
||||
@ -194,5 +207,12 @@ public class ProvinceCityArea {
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public String getAheadText() {
|
||||
return aheadText;
|
||||
}
|
||||
public void setAheadText(String aheadText) {
|
||||
this.aheadText = aheadText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,10 +26,13 @@ package org.jeecg.common.constant;
|
||||
public interface ServiceNameConstants {
|
||||
|
||||
/**
|
||||
* 系统管理 admin
|
||||
* 微服务名:系统管理模块
|
||||
*/
|
||||
String SYSTEM_SERVICE = "jeecg-system";
|
||||
String SYSTEM_ONLINE = "jeecg-online";
|
||||
String SERVICE_SYSTEM = "jeecg-system";
|
||||
/**
|
||||
* 微服务名:Demo模块
|
||||
*/
|
||||
String SERVICE_DEMO = "jeecg-demo";
|
||||
|
||||
/**
|
||||
* gateway通过header传递根路径 basePath
|
||||
|
||||
@ -0,0 +1,119 @@
|
||||
package org.jeecg.common.constant;
|
||||
|
||||
/**
|
||||
* @Description: 符号和特殊符号常用类
|
||||
* @author: wangshuai
|
||||
* @date: 2022年03月30日 17:44
|
||||
*/
|
||||
public class SymbolConstant {
|
||||
|
||||
/**
|
||||
* 符号:点
|
||||
*/
|
||||
public static final String SPOT = ".";
|
||||
|
||||
/**
|
||||
* 符号:双斜杠
|
||||
*/
|
||||
public static final String DOUBLE_BACKSLASH = "\\";
|
||||
|
||||
/**
|
||||
* 符号:冒号
|
||||
*/
|
||||
public static final String COLON = ":";
|
||||
|
||||
/**
|
||||
* 符号:逗号
|
||||
*/
|
||||
public static final String COMMA = ",";
|
||||
|
||||
/**
|
||||
* 符号:左花括号 }
|
||||
*/
|
||||
public static final String LEFT_CURLY_BRACKET = "{";
|
||||
|
||||
/**
|
||||
* 符号:右花括号 }
|
||||
*/
|
||||
public static final String RIGHT_CURLY_BRACKET = "}";
|
||||
|
||||
/**
|
||||
* 符号:井号 #
|
||||
*/
|
||||
public static final String WELL_NUMBER = "#";
|
||||
|
||||
/**
|
||||
* 符号:单斜杠
|
||||
*/
|
||||
public static final String SINGLE_SLASH = "/";
|
||||
|
||||
/**
|
||||
* 符号:双斜杠
|
||||
*/
|
||||
public static final String DOUBLE_SLASH = "//";
|
||||
|
||||
/**
|
||||
* 符号:感叹号
|
||||
*/
|
||||
public static final String EXCLAMATORY_MARK = "!";
|
||||
|
||||
/**
|
||||
* 符号:下划线
|
||||
*/
|
||||
public static final String UNDERLINE = "_";
|
||||
|
||||
/**
|
||||
* 符号:单引号
|
||||
*/
|
||||
public static final String SINGLE_QUOTATION_MARK = "'";
|
||||
|
||||
/**
|
||||
* 符号:星号
|
||||
*/
|
||||
public static final String ASTERISK = "*";
|
||||
|
||||
/**
|
||||
* 符号:百分号
|
||||
*/
|
||||
public static final String PERCENT_SIGN = "%";
|
||||
|
||||
/**
|
||||
* 符号:美元 $
|
||||
*/
|
||||
public static final String DOLLAR = "$";
|
||||
|
||||
/**
|
||||
* 符号:和 &
|
||||
*/
|
||||
public static final String AND = "&";
|
||||
|
||||
/**
|
||||
* 符号:../
|
||||
*/
|
||||
public static final String SPOT_SINGLE_SLASH = "../";
|
||||
|
||||
/**
|
||||
* 符号:..\\
|
||||
*/
|
||||
public static final String SPOT_DOUBLE_BACKSLASH = "..\\";
|
||||
|
||||
/**
|
||||
* 系统变量前缀 #{
|
||||
*/
|
||||
public static final String SYS_VAR_PREFIX = "#{";
|
||||
|
||||
/**
|
||||
* 符号 {{
|
||||
*/
|
||||
public static final String DOUBLE_LEFT_CURLY_BRACKET = "{{";
|
||||
|
||||
/**
|
||||
* 符号:[
|
||||
*/
|
||||
public static final String SQUARE_BRACKETS_LEFT = "[";
|
||||
/**
|
||||
* 符号:]
|
||||
*/
|
||||
public static final String SQUARE_BRACKETS_RIGHT = "]";
|
||||
|
||||
}
|
||||
@ -2,8 +2,11 @@ package org.jeecg.common.constant;
|
||||
|
||||
/**
|
||||
* VXESocket 常量
|
||||
*
|
||||
* update: 【类名改了大小写】 date: 2022-04-18
|
||||
* @author: jeecg-boot
|
||||
*/
|
||||
public class VXESocketConst {
|
||||
public class VxeSocketConst {
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user