mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-31 22:11:57 +08:00
Compare commits
47 Commits
290c50c74c
...
v3.6.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8aca11c2a2 | ||
|
|
725033e361 | ||
|
|
d29e49e23b | ||
|
|
706c3bb69b | ||
|
|
cd0ee95b9c | ||
|
|
3293e2fb56 | ||
|
|
924ec0eb6e | ||
|
|
135b1204a9 | ||
|
|
cb566a704b | ||
|
|
aadba0382e | ||
|
|
a0ce1cf33b | ||
|
|
3915c77391 | ||
|
|
b80932ceb4 | ||
|
|
056cf94082 | ||
|
|
0dcd3e6183 | ||
|
|
07be5ceb26 | ||
|
|
cc59502d7c | ||
|
|
98738f23ad | ||
|
|
57fe1c663e | ||
|
|
7b6fdb3a89 | ||
|
|
79c885decb | ||
|
|
1a0f37a2dc | ||
|
|
02de344d8c | ||
|
|
189100f74e | ||
|
|
e29284e687 | ||
|
|
d4af286f41 | ||
|
|
60e2d55a23 | ||
|
|
bbd112d5a3 | ||
|
|
90922844ea | ||
|
|
3a9f56f04b | ||
|
|
a1ec1d57d4 | ||
|
|
060959a7c5 | ||
|
|
43e1d8d573 | ||
|
|
67cf51ba77 | ||
|
|
a256618d5d | ||
|
|
a6bcebb62b | ||
|
|
1cb262daa3 | ||
|
|
8c096cba8d | ||
|
|
088cec8adf | ||
|
|
85ff6a9910 | ||
|
|
cab5beaca7 | ||
|
|
fc8069a250 | ||
|
|
924e705dca | ||
|
|
049ba453d1 | ||
|
|
4aa261e8f7 | ||
|
|
914a6620f5 | ||
|
|
3dcee7057d |
@@ -1,11 +1,11 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-b99b286755aef70355a7084753f89cdb7c9.png">
|
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-b99b286755aef70355a7084753f89cdb7c9.png">
|
||||||
</p>
|
</p>
|
||||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.6.5</h1>
|
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.6.6</h1>
|
||||||
<h4 align="center">基于 Vue/Element UI 和 Spring Boot/Spring Cloud & Alibaba 前后端分离的分布式微服务架构</h4>
|
<h4 align="center">基于 Vue/Element UI 和 Spring Boot/Spring Cloud & Alibaba 前后端分离的分布式微服务架构</h4>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://gitee.com/y_project/RuoYi-Cloud/stargazers"><img src="https://gitee.com/y_project/RuoYi-Cloud/badge/star.svg?theme=dark"></a>
|
<a href="https://gitee.com/y_project/RuoYi-Cloud/stargazers"><img src="https://gitee.com/y_project/RuoYi-Cloud/badge/star.svg?theme=dark"></a>
|
||||||
<a href="https://gitee.com/y_project/RuoYi-Cloud"><img src="https://img.shields.io/badge/RuoYi-v3.6.5-brightgreen.svg"></a>
|
<a href="https://gitee.com/y_project/RuoYi-Cloud"><img src="https://img.shields.io/badge/RuoYi-v3.6.6-brightgreen.svg"></a>
|
||||||
<a href="https://gitee.com/y_project/RuoYi-Cloud/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
|
<a href="https://gitee.com/y_project/RuoYi-Cloud/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
# Kubernates 部署Ruoyi-Cloud项目
|
|
||||||
|
|
||||||
本部署所用到的k8s配置均为简易版,仅作为初步入门学习使用,有不合理的地方还请见谅。
|
|
||||||
|
|
||||||
### 后期考虑功能:
|
|
||||||
* HPA自动扩缩容
|
|
||||||
* MySQL主从、Redis集群、服务集群
|
|
||||||
* ELK日志收集
|
|
||||||
|
|
||||||
## 容器分布
|
|
||||||
~~~
|
|
||||||
namespace
|
|
||||||
├── redis
|
|
||||||
│ └── redis // StatefulSet
|
|
||||||
├── kube-ruoyi
|
|
||||||
│ └── ruoyi-mysql // Deployment
|
|
||||||
│ └── ruoyi-nacos
|
|
||||||
│ └── ruoyi-nginx
|
|
||||||
│ └── ruoyi-sentinel
|
|
||||||
│ └── ruoyi-gateway
|
|
||||||
│ └── ruoyi-auth
|
|
||||||
│ └── ruoyi-system
|
|
||||||
│ └── ruoyi-gen
|
|
||||||
│ └── ruoyi-job
|
|
||||||
│ └── ruoyi-file
|
|
||||||
│ └── ruoyi-monitor
|
|
||||||
│ └── elasticsearch
|
|
||||||
│ └── skywalking
|
|
||||||
│ └── skywalking-ui
|
|
||||||
├── minio
|
|
||||||
│ └── minio
|
|
||||||
├── monitor-sa
|
|
||||||
│ └── node-exporter
|
|
||||||
│ └── prometheus-server
|
|
||||||
│ └── monitoring-grafana
|
|
||||||
~~~
|
|
||||||
|
|
||||||
## 部署顺序及要点
|
|
||||||
1. Redis
|
|
||||||
2. MySQL,手动Dockerfile打包镜像,初始化准备好的数据脚本。使用了Secret加密密码等配置。
|
|
||||||
3. Nacos, 配置好MODE=standalone,使用configMap设置数据库。
|
|
||||||
4. Sentinel
|
|
||||||
5. Gateway,本服务需要用Dockerfile打包镜像,否则会报错。其他RuoYi服务可以直接使用spring-boot的image命令一键打包生成镜像[每个服务都有使用额外的SpringBoot配置文件(bootstrap-k8s.yml)加入到服务中,同时在原配置文件中把active换成${SPRING_PROFILES_ACTIVE:dev}后再打包,以读取deployment的env变量。启动服务前记得提前在nacos中克隆,新增服务配置以把dev改成k8s(deployment中启动的环境是SPRING_PROFILES_ACTIVE=k8s),修改好Redis地址(redis.redis)、MySQL地址(ruoyi-mysql)、Sentinel地址(ruoyi-sentinel)]
|
|
||||||
6. Nginx,部署之前先打包好前端静态文件,使用本地磁盘方式挂载到容器 (注:我使用的是Window的DockerDesktop启动的K8s,挂载磁盘路径必须带/run/desktop/mnt/host),修改好nginx配置ruoyi-gateway就可以启动(启动后输入localhost:30080就可以访问前端项目)。
|
|
||||||
7. Auth
|
|
||||||
8. System,配置好后就可以登录了
|
|
||||||
9. Gen
|
|
||||||
10. Job
|
|
||||||
11. File,改成minio服务之后需要修改静态文件中读取文件的端口地址
|
|
||||||
12. Monitor,需要修改前端静态文件中的Monitor端口地址
|
|
||||||
13. Minio,挂载本地文件。修改ruoyi-file服务中@Primary注释改到MinioServer上以使用Minio服务(记得修改nacos配置)
|
|
||||||
14. Elasticsearch,部署文件一并放入到了skywalking文件夹中
|
|
||||||
15. skywalking,需要在Java服务中使用agent进行跟踪(自制agent镜像然后使用initContainers方式挂载到同一个容器,模板放到了agent-in-server文件)
|
|
||||||
16. skywalking-ui
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
name: minio
|
|
||||||
name: minio
|
|
||||||
namespace: minio
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: minio
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: minio
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: minio
|
|
||||||
image: minio/minio
|
|
||||||
imagePullPolicy: Always
|
|
||||||
ports:
|
|
||||||
- containerPort: 9000
|
|
||||||
name: tcp
|
|
||||||
- containerPort: 9090
|
|
||||||
protocol: TCP
|
|
||||||
name: console
|
|
||||||
command:
|
|
||||||
- /bin/sh
|
|
||||||
- -c
|
|
||||||
- minio server /data --console-address ":9090"
|
|
||||||
env:
|
|
||||||
- name: MINIO_ACCESS_KEY
|
|
||||||
value: minioadmin
|
|
||||||
- name: MINIO_SECRET_KEY
|
|
||||||
value: minioadmin
|
|
||||||
readinessProbe:
|
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
|
||||||
path: /minio/health/ready
|
|
||||||
port: 9000
|
|
||||||
scheme: HTTP
|
|
||||||
initialDelaySeconds: 10
|
|
||||||
periodSeconds: 10
|
|
||||||
successThreshold: 1
|
|
||||||
timeoutSeconds: 5
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /data
|
|
||||||
name: minio-data
|
|
||||||
volumes:
|
|
||||||
- name: minio-data
|
|
||||||
hostPath:
|
|
||||||
path: /run/desktop/mnt/host/c/k8sVolume/minio/data
|
|
||||||
type: Directory
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: minio
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: minio
|
|
||||||
namespace: minio
|
|
||||||
labels:
|
|
||||||
app: minio
|
|
||||||
spec:
|
|
||||||
type: NodePort
|
|
||||||
publishNotReadyAddresses: true
|
|
||||||
ports:
|
|
||||||
- port: 9000
|
|
||||||
name: tcp
|
|
||||||
targetPort: 9000
|
|
||||||
- port: 9090
|
|
||||||
name: console
|
|
||||||
targetPort: 9090
|
|
||||||
nodePort: 30090
|
|
||||||
selector:
|
|
||||||
app: minio
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: monitor-sa
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: DaemonSet
|
|
||||||
metadata:
|
|
||||||
name: node-exporter
|
|
||||||
namespace: monitor-sa
|
|
||||||
labels:
|
|
||||||
name: node-exporter
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
name: node-exporter
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
name: node-exporter
|
|
||||||
spec:
|
|
||||||
hostPID: true
|
|
||||||
hostIPC: true
|
|
||||||
hostNetwork: true # 共享宿主机网络和进程
|
|
||||||
containers:
|
|
||||||
- name: node-exporter
|
|
||||||
image: prom/node-exporter:v0.16.0
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
ports:
|
|
||||||
- containerPort: 9100 # 容器暴露端口为9100
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 0.15
|
|
||||||
securityContext:
|
|
||||||
privileged: true # 开启特权模式
|
|
||||||
args:
|
|
||||||
- --path.procfs
|
|
||||||
- /host/proc
|
|
||||||
- --path.sysfs
|
|
||||||
- /host/sys
|
|
||||||
- --collector.filesystem.ignored-mount-points
|
|
||||||
- '"^/(sys|proc|dev|host|etc)($|/)"'
|
|
||||||
volumeMounts: # 挂载宿主机目录以收集宿主机信息
|
|
||||||
- name: dev
|
|
||||||
mountPath: /host/dev
|
|
||||||
- name: proc
|
|
||||||
mountPath: /host/proc
|
|
||||||
- name: sys
|
|
||||||
mountPath: /host/sys
|
|
||||||
- name: rootfs
|
|
||||||
mountPath: /rootfs
|
|
||||||
tolerations: # 定义容忍度,使其可调度到默认有污点的master
|
|
||||||
- key: "node-role.kubernetes.io/master"
|
|
||||||
operator: "Exists"
|
|
||||||
effect: "NoSchedule"
|
|
||||||
volumes: # 定义存储卷
|
|
||||||
- name: proc
|
|
||||||
hostPath:
|
|
||||||
path: /proc
|
|
||||||
- name: dev
|
|
||||||
hostPath:
|
|
||||||
path: /dev
|
|
||||||
- name: sys
|
|
||||||
hostPath:
|
|
||||||
path: /sys
|
|
||||||
- name: rootfs
|
|
||||||
hostPath:
|
|
||||||
path: /
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap #
|
|
||||||
metadata:
|
|
||||||
name: prometheus-config
|
|
||||||
namespace: kube-system
|
|
||||||
labels:
|
|
||||||
kubernetes.io/cluster-service: "true"
|
|
||||||
addonmanager.kubernetes.io/mode: EnsureExists
|
|
||||||
data:
|
|
||||||
prometheus.yml: |
|
|
||||||
rule_files:
|
|
||||||
- /etc/config/rules/*.rules
|
|
||||||
|
|
||||||
scrape_configs:
|
|
||||||
- job_name: prometheus
|
|
||||||
static_configs:
|
|
||||||
- targets:
|
|
||||||
- localhost:9090
|
|
||||||
|
|
||||||
- job_name: kubernetes-nodes
|
|
||||||
scrape_interval: 30s
|
|
||||||
static_configs:
|
|
||||||
- targets:
|
|
||||||
- 192.168.73.135:9100
|
|
||||||
- 192.168.73.138:9100
|
|
||||||
- 192.168.73.139:9100
|
|
||||||
- 192.168.73.140:9100
|
|
||||||
|
|
||||||
- job_name: kubernetes-apiservers
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: endpoints
|
|
||||||
relabel_configs:
|
|
||||||
- action: keep
|
|
||||||
regex: default;kubernetes;https
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_namespace
|
|
||||||
- __meta_kubernetes_service_name
|
|
||||||
- __meta_kubernetes_endpoint_port_name
|
|
||||||
scheme: https
|
|
||||||
tls_config:
|
|
||||||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
||||||
insecure_skip_verify: true
|
|
||||||
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
||||||
|
|
||||||
- job_name: kubernetes-nodes-kubelet
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: node
|
|
||||||
relabel_configs:
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_node_label_(.+)
|
|
||||||
scheme: https
|
|
||||||
tls_config:
|
|
||||||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
||||||
insecure_skip_verify: true
|
|
||||||
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
||||||
|
|
||||||
- job_name: kubernetes-nodes-cadvisor
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: node
|
|
||||||
relabel_configs:
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_node_label_(.+)
|
|
||||||
- target_label: __metrics_path__
|
|
||||||
replacement: /metrics/cadvisor
|
|
||||||
scheme: https
|
|
||||||
tls_config:
|
|
||||||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
||||||
insecure_skip_verify: true
|
|
||||||
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
||||||
|
|
||||||
- job_name: kubernetes-service-endpoints
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: endpoints
|
|
||||||
relabel_configs:
|
|
||||||
- action: keep
|
|
||||||
regex: true
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_service_annotation_prometheus_io_scrape
|
|
||||||
- action: replace
|
|
||||||
regex: (https?)
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_service_annotation_prometheus_io_scheme
|
|
||||||
target_label: __scheme__
|
|
||||||
- action: replace
|
|
||||||
regex: (.+)
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_service_annotation_prometheus_io_path
|
|
||||||
target_label: __metrics_path__
|
|
||||||
- action: replace
|
|
||||||
regex: ([^:]+)(?::\d+)?;(\d+)
|
|
||||||
replacement: $1:$2
|
|
||||||
source_labels:
|
|
||||||
- __address__
|
|
||||||
- __meta_kubernetes_service_annotation_prometheus_io_port
|
|
||||||
target_label: __address__
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_service_label_(.+)
|
|
||||||
- action: replace
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_namespace
|
|
||||||
target_label: kubernetes_namespace
|
|
||||||
- action: replace
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_service_name
|
|
||||||
target_label: kubernetes_name
|
|
||||||
|
|
||||||
- job_name: kubernetes-services
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: service
|
|
||||||
metrics_path: /probe
|
|
||||||
params:
|
|
||||||
module:
|
|
||||||
- http_2xx
|
|
||||||
relabel_configs:
|
|
||||||
- action: keep
|
|
||||||
regex: true
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_service_annotation_prometheus_io_probe
|
|
||||||
- source_labels:
|
|
||||||
- __address__
|
|
||||||
target_label: __param_target
|
|
||||||
- replacement: blackbox
|
|
||||||
target_label: __address__
|
|
||||||
- source_labels:
|
|
||||||
- __param_target
|
|
||||||
target_label: instance
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_service_label_(.+)
|
|
||||||
- source_labels:
|
|
||||||
- __meta_kubernetes_namespace
|
|
||||||
target_label: kubernetes_namespace
|
|
||||||
- source_labels:
|
|
||||||
- __meta_kubernetes_service_name
|
|
||||||
target_label: kubernetes_name
|
|
||||||
|
|
||||||
- job_name: kubernetes-pods
|
|
||||||
kubernetes_sd_configs:
|
|
||||||
- role: pod
|
|
||||||
relabel_configs:
|
|
||||||
- action: keep
|
|
||||||
regex: true
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_pod_annotation_prometheus_io_scrape
|
|
||||||
- action: replace
|
|
||||||
regex: (.+)
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_pod_annotation_prometheus_io_path
|
|
||||||
target_label: __metrics_path__
|
|
||||||
- action: replace
|
|
||||||
regex: ([^:]+)(?::\d+)?;(\d+)
|
|
||||||
replacement: $1:$2
|
|
||||||
source_labels:
|
|
||||||
- __address__
|
|
||||||
- __meta_kubernetes_pod_annotation_prometheus_io_port
|
|
||||||
target_label: __address__
|
|
||||||
- action: labelmap
|
|
||||||
regex: __meta_kubernetes_pod_label_(.+)
|
|
||||||
- action: replace
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_namespace
|
|
||||||
target_label: kubernetes_namespace
|
|
||||||
- action: replace
|
|
||||||
source_labels:
|
|
||||||
- __meta_kubernetes_pod_name
|
|
||||||
target_label: kubernetes_pod_name
|
|
||||||
alerting:
|
|
||||||
alertmanagers:
|
|
||||||
- static_configs:
|
|
||||||
- targets: ["alertmanager:80"]
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
存放sql目录下的所有脚本,用于docker自动执行。
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# 基础镜像
|
|
||||||
FROM mysql:5.7
|
|
||||||
|
|
||||||
# 执行sql脚本
|
|
||||||
ADD ./db/*.sql /docker-entrypoint-initdb.d/
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-mysql #指定deployment的名字
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels:
|
|
||||||
app: ruoyi-mysql-local
|
|
||||||
spec: #规约
|
|
||||||
replicas: 1 #pod的副本数量,就是希望创建多少个pod的副本.可p选字段。它的默认值是1。
|
|
||||||
selector: #selector 字段定义 Deployment 如何查找要管理的 Pods。必须匹配 .spec.template.metadata.labels,否则请求会被 API 拒绝。
|
|
||||||
matchLabels:
|
|
||||||
app: ruoyi-mysql-local
|
|
||||||
template: #Deployment Pod 模板;它和 Pod 的语法规则完全相同。 只是这里它是嵌套的,因此不需要 apiVersion 或 kind。
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: ruoyi-mysql-local
|
|
||||||
spec: #pod模板规约
|
|
||||||
containers: #容器
|
|
||||||
- name: ruoyi-mysql #容器的名称
|
|
||||||
image: ruoyi/mysql:5.7 #容器使用的镜像
|
|
||||||
ports:
|
|
||||||
- containerPort: 3306
|
|
||||||
volumeMounts:
|
|
||||||
- name: mysql-local-data #pv的name
|
|
||||||
mountPath: /var/lib/mysql #MySQL容器的数据都是存在这个目录的,要对这个目录做数据持久化
|
|
||||||
env:
|
|
||||||
- name: MYSQL_ROOT_PASSWORD
|
|
||||||
valueFrom: # Read environment variables from kubernetes secrets
|
|
||||||
secretKeyRef:
|
|
||||||
name: ruoyi-mysql-secret
|
|
||||||
key: mysql-root-pass
|
|
||||||
- name: MYSQL_USER
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: ruoyi-mysql-secret
|
|
||||||
key: mysql-user
|
|
||||||
- name: MYSQL_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: ruoyi-mysql-secret
|
|
||||||
key: mysql-password
|
|
||||||
volumes:
|
|
||||||
- name: mysql-local-data #pv的name
|
|
||||||
hostPath:
|
|
||||||
path: /run/desktop/mnt/host/c/k8sVolume/mysql/data
|
|
||||||
type: Directory
|
|
||||||
restartPolicy: Always #Deployment 中的 Pod 模板必须指定适当的标签和适当的重新启动策略。只有 .spec.template.spec.restartPolicy 等于 Always 才是被允许的,这也是在没有指定时的默认设置
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolume
|
|
||||||
metadata:
|
|
||||||
name: mysql-pv
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
capacity:
|
|
||||||
storage: 3Gi
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteMany
|
|
||||||
persistentVolumeReclaimPolicy: Retain # 手动删除
|
|
||||||
storageClassName: hostpath #表明这个pv所属的storageClass
|
|
||||||
hostPath:
|
|
||||||
path: /mnt/data #节点上卷的完整路径。(必须是存在的路径,不然容器无法创建,deployment会报错)可以是目录或块设备(磁盘、分区…)。
|
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: mysql-pvc-local
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
accessModes: #访问模式 申领在请求具有特定访问模式的存储时,使用与卷相同的访问模式约定。
|
|
||||||
- ReadWriteMany
|
|
||||||
volumeMode: Filesystem #卷模式
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 1Gi
|
|
||||||
storageClassName: hostpath # 此处须显式设置空字符串或指定值,否则会被设置为默认的 StorageClass
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-mysql-secret
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
type: Opaque #base-64加密
|
|
||||||
data:
|
|
||||||
mysql-root-pass: cGFzc3dvcmQ=
|
|
||||||
mysql-user: YWRtaW4=
|
|
||||||
mysql-password: MTIzNDU2
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-mysql
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 3306
|
|
||||||
nodePort: 30060
|
|
||||||
selector:
|
|
||||||
app: ruoyi-mysql-local # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上(targetPort:容器接收流量的端口;port:可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
|
|
||||||
type: NodePort
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-nacos-config
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
data:
|
|
||||||
application.properties: |
|
|
||||||
spring.datasource.platform=mysql
|
|
||||||
db.num=1
|
|
||||||
db.url.0=jdbc:mysql://ruoyi-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
|
|
||||||
db.user=root
|
|
||||||
db.password=password
|
|
||||||
nacos.naming.empty-service.auto-clean=true
|
|
||||||
nacos.naming.empty-service.clean.initial-delay-ms=50000
|
|
||||||
nacos.naming.empty-service.clean.period-time-ms=30000
|
|
||||||
management.endpoints.web.exposure.include=*
|
|
||||||
management.metrics.export.elastic.enabled=false
|
|
||||||
management.metrics.export.influx.enabled=false
|
|
||||||
server.tomcat.accesslog.enabled=true
|
|
||||||
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
|
|
||||||
server.tomcat.basedir=/home/ruoyi/nacos/tomcat/logs
|
|
||||||
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
|
|
||||||
nacos.core.auth.system.type=nacos
|
|
||||||
nacos.core.auth.enabled=false
|
|
||||||
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
|
|
||||||
nacos.core.auth.plugin.nacos.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
|
|
||||||
nacos.core.auth.caching.enabled=true
|
|
||||||
nacos.core.auth.enable.userAgentAuthWhite=false
|
|
||||||
nacos.core.auth.server.identity.key=serverIdentity
|
|
||||||
nacos.core.auth.server.identity.value=security
|
|
||||||
nacos.istio.mcp.server.enabled=false
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-nacos
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: ruoyi-nacos
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: ruoyi-nacos
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-nacos
|
|
||||||
image: nacos/nacos-server
|
|
||||||
imagePullPolicy: Always
|
|
||||||
ports:
|
|
||||||
- containerPort: 8848
|
|
||||||
name: client
|
|
||||||
- containerPort: 9848
|
|
||||||
name: client-rpc
|
|
||||||
- containerPort: 9849
|
|
||||||
name: raft-rpc
|
|
||||||
env:
|
|
||||||
- name: MODE
|
|
||||||
value: standalone
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /home/nacos/conf/application.properties
|
|
||||||
name: nacos-conf
|
|
||||||
subPath: application.properties
|
|
||||||
volumes:
|
|
||||||
- name: nacos-conf
|
|
||||||
configMap:
|
|
||||||
name: ruoyi-nacos-config
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-nacos
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels:
|
|
||||||
app: ruoyi-nacos
|
|
||||||
spec:
|
|
||||||
type: NodePort
|
|
||||||
publishNotReadyAddresses: true
|
|
||||||
ports:
|
|
||||||
- port: 8848
|
|
||||||
name: server
|
|
||||||
targetPort: 8848
|
|
||||||
nodePort: 30848
|
|
||||||
- port: 9848
|
|
||||||
name: client-rpc
|
|
||||||
targetPort: 9848
|
|
||||||
- port: 9849
|
|
||||||
name: raft-rpc
|
|
||||||
targetPort: 9849
|
|
||||||
selector:
|
|
||||||
app: ruoyi-nacos
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-nginx-config
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
data:
|
|
||||||
nginx.conf: |
|
|
||||||
worker_processes 1;
|
|
||||||
events {
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
http {
|
|
||||||
include mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
sendfile on;
|
|
||||||
keepalive_timeout 65;
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name localhost;
|
|
||||||
location / {
|
|
||||||
root /home/ruoyi/projects/ruoyi-ui;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
index index.html index.htm;
|
|
||||||
}
|
|
||||||
location /prod-api/{
|
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header REMOTE-HOST $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_pass http://ruoyi-gateway:8080/;
|
|
||||||
}
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
|
||||||
location = /50x.html {
|
|
||||||
root html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-nginx
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: ruoyi-nginx
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: ruoyi-nginx
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-nginx
|
|
||||||
image: nginx
|
|
||||||
imagePullPolicy: Always
|
|
||||||
ports:
|
|
||||||
- containerPort: 80
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /etc/nginx/nginx.conf
|
|
||||||
name: nginx-conf
|
|
||||||
subPath: nginx.conf
|
|
||||||
- mountPath: /home/ruoyi/projects/ruoyi-ui
|
|
||||||
name: local-path #/usr/share/nginx/html 挂载到volumes中server+path
|
|
||||||
volumes:
|
|
||||||
- name: nginx-conf
|
|
||||||
configMap:
|
|
||||||
name: ruoyi-nginx-config
|
|
||||||
- name: local-path
|
|
||||||
hostPath:
|
|
||||||
path: /run/desktop/mnt/host/c/k8sVolume/dist
|
|
||||||
type: Directory
|
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-nginx
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels:
|
|
||||||
name: ruoyi-nginx
|
|
||||||
spec:
|
|
||||||
type: NodePort
|
|
||||||
ports:
|
|
||||||
- port: 80
|
|
||||||
targetPort: 80
|
|
||||||
nodePort: 30080
|
|
||||||
selector:
|
|
||||||
app: ruoyi-nginx
|
|
||||||
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: redis-config
|
|
||||||
namespace: redis
|
|
||||||
data:
|
|
||||||
redis.conf: |-
|
|
||||||
maxmemory 1000mb
|
|
||||||
maxmemory-policy allkeys-lru
|
|
||||||
protected-mode no
|
|
||||||
tcp-backlog 511
|
|
||||||
daemonize no
|
|
||||||
supervised no
|
|
||||||
dir /data
|
|
||||||
pidfile /data/redis_6379.pid
|
|
||||||
port 6379
|
|
||||||
loglevel notice
|
|
||||||
logfile ""
|
|
||||||
databases 16
|
|
||||||
stop-writes-on-bgsave-error yes
|
|
||||||
rdbcompression yes
|
|
||||||
rdbchecksum yes
|
|
||||||
dbfilename dump.rdb
|
|
||||||
replica-serve-stale-data yes
|
|
||||||
replica-read-only no
|
|
||||||
repl-diskless-sync no
|
|
||||||
repl-diskless-sync-delay 5
|
|
||||||
repl-disable-tcp-nodelay no
|
|
||||||
replica-priority 100
|
|
||||||
lazyfree-lazy-eviction no
|
|
||||||
lazyfree-lazy-expire no
|
|
||||||
lazyfree-lazy-server-del no
|
|
||||||
replica-lazy-flush no
|
|
||||||
appendonly no
|
|
||||||
appendfilename "appendonly.aof"
|
|
||||||
appendfsync everysec
|
|
||||||
no-appendfsync-on-rewrite no
|
|
||||||
auto-aof-rewrite-percentage 100
|
|
||||||
auto-aof-rewrite-min-size 64mb
|
|
||||||
aof-load-truncated yes
|
|
||||||
aof-use-rdb-preamble yes
|
|
||||||
lua-time-limit 5000
|
|
||||||
slowlog-log-slower-than 10000
|
|
||||||
slowlog-max-len 128
|
|
||||||
latency-monitor-threshold 0
|
|
||||||
notify-keyspace-events ""
|
|
||||||
set-max-intset-entries 512
|
|
||||||
hll-sparse-max-bytes 3000
|
|
||||||
stream-node-max-bytes 4096
|
|
||||||
stream-node-max-entries 100
|
|
||||||
activerehashing yes
|
|
||||||
client-output-buffer-limit normal 0 0 0
|
|
||||||
client-output-buffer-limit replica 256mb 64mb 60
|
|
||||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
|
||||||
hz 10
|
|
||||||
dynamic-hz yes
|
|
||||||
aof-rewrite-incremental-fsync yes
|
|
||||||
rdb-save-incremental-fsync yes
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: redis
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: redis
|
|
||||||
labels:
|
|
||||||
app: redis
|
|
||||||
namespace: redis
|
|
||||||
spec:
|
|
||||||
serviceName: redis
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: redis
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: redis
|
|
||||||
spec:
|
|
||||||
initContainers:
|
|
||||||
- name: config
|
|
||||||
image: redis:7.0.6
|
|
||||||
command: [ "sh", "-c" ]
|
|
||||||
args:
|
|
||||||
- |
|
|
||||||
cp /tmp/redis/redis.conf /etc/redis/redis.conf
|
|
||||||
|
|
||||||
echo "finding master..."
|
|
||||||
MASTER_FDQN=`hostname -f | sed -e 's/redis-[0-9]\./redis-0./'`
|
|
||||||
if [ "$(redis-cli -h sentinel -p 5000 ping)" != "PONG" ]; then
|
|
||||||
echo "master not found, defaulting to redis-0"
|
|
||||||
if [ "$(hostname)" = "redis-0" ]; then
|
|
||||||
echo "this is redis-0, not updating config..."
|
|
||||||
else
|
|
||||||
echo "updating redis.conf..."
|
|
||||||
echo "\nslaveof $MASTER_FDQN 6379" >> /etc/redis/redis.conf
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "sentinel found, finding master"
|
|
||||||
MASTER="$(redis-cli -h sentinel -p 5000 sentinel get-master-addr-by-name mymaster | grep -E '(^redis-\d{1,})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})')"
|
|
||||||
echo "master found : $MASTER, updating redis.conf"
|
|
||||||
echo "slaveof $MASTER 6379" >> /etc/redis/redis.conf
|
|
||||||
fi
|
|
||||||
volumeMounts:
|
|
||||||
- name: redis-config
|
|
||||||
mountPath: /etc/redis/
|
|
||||||
- name: config
|
|
||||||
mountPath: /tmp/redis/
|
|
||||||
containers:
|
|
||||||
- name: redis
|
|
||||||
image: redis:7.0.6
|
|
||||||
command: [ "redis-server" ]
|
|
||||||
args: [ "/etc/redis/redis.conf" ]
|
|
||||||
ports:
|
|
||||||
- containerPort: 6379
|
|
||||||
name: redis
|
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: /data
|
|
||||||
- name: redis-config
|
|
||||||
mountPath: /etc/redis/
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
memory: 1100Mi
|
|
||||||
requests:
|
|
||||||
memory: 1100Mi
|
|
||||||
volumes:
|
|
||||||
- name: redis-config
|
|
||||||
emptyDir: { }
|
|
||||||
- name: config
|
|
||||||
configMap:
|
|
||||||
name: redis-config
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: data
|
|
||||||
spec:
|
|
||||||
storageClassName: hostpath
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 500Mi
|
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: redis # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: redis
|
|
||||||
namespace: redis
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: redis # The service exposes Pods with label `app=redis`
|
|
||||||
ports:
|
|
||||||
- name: redis-port
|
|
||||||
port: 6379
|
|
||||||
nodePort: 30079
|
|
||||||
type: NodePort
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: kube-ruoyi
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-sentinel
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: ruoyi-sentinel
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: ruoyi-sentinel
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-sentinel
|
|
||||||
image: bladex/sentinel-dashboard
|
|
||||||
imagePullPolicy: Always
|
|
||||||
ports:
|
|
||||||
- containerPort: 8858
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: JAVA_TOOL_OPTIONS
|
|
||||||
value: "-Dserver.port=8858 -Dcsp.sentinel.dashboard.server=localhost:8858 -Dproject.name=sentinel-dashboard"
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-sentinel
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels:
|
|
||||||
name: ruoyi-sentinel
|
|
||||||
spec:
|
|
||||||
type: NodePort
|
|
||||||
ports:
|
|
||||||
- port: 8858
|
|
||||||
targetPort: 8858
|
|
||||||
nodePort: 30858
|
|
||||||
selector:
|
|
||||||
app: ruoyi-sentinel
|
|
||||||
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
apiVersion: apps/v1 # API version
|
|
||||||
kind: Deployment # Type of kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-auth # Name of the kubernetes resource
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-auth
|
|
||||||
spec:
|
|
||||||
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
||||||
selector:
|
|
||||||
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
||||||
app: ruoyi-auth
|
|
||||||
template: # Template for creating the pods in this deployment
|
|
||||||
metadata:
|
|
||||||
labels: # Labels that will be applied to each Pod in this deployment
|
|
||||||
app: ruoyi-auth
|
|
||||||
spec: # Spec for the containers that will be run in the Pods
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-auth-server
|
|
||||||
image: ruoyi-auth:3.6.2
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 9200 # The port that the container exposes
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
|
||||||
value: k8s
|
|
||||||
- name: SERVER_NAME
|
|
||||||
value: ruoyi-auth
|
|
||||||
- name: NACOS_SERVER
|
|
||||||
value: ruoyi-nacos # nacos svc name
|
|
||||||
- name: NACOS_PORT
|
|
||||||
value: "8848"
|
|
||||||
- name: NACOS_SHARED_CONFIGS
|
|
||||||
value: application-dev.yml
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-auth # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-auth
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
||||||
selector:
|
|
||||||
app: ruoyi-auth # The service exposes Pods with label `app=ruoyi-auth`
|
|
||||||
ports: # Forward incoming connections on port 9200 to the target port 9200
|
|
||||||
- name: http
|
|
||||||
port: 9200
|
|
||||||
targetPort: 9200
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
apiVersion: apps/v1 # API version
|
|
||||||
kind: Deployment # Type of kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-gateway # Name of the kubernetes resource
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-gateway
|
|
||||||
spec:
|
|
||||||
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
||||||
selector:
|
|
||||||
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
||||||
app: ruoyi-gateway
|
|
||||||
template: # Template for creating the pods in this deployment
|
|
||||||
metadata:
|
|
||||||
labels: # Labels that will be applied to each Pod in this deployment
|
|
||||||
app: ruoyi-gateway
|
|
||||||
spec: # Spec for the containers that will be run in the Pods
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-gateway-server
|
|
||||||
image: ruoyi-gateway:3.6.2
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 8080 # The port that the container exposes
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
|
||||||
value: k8s
|
|
||||||
- name: SERVER_NAME
|
|
||||||
value: ruoyi-gateway
|
|
||||||
- name: NACOS_SERVER
|
|
||||||
value: ruoyi-nacos # nacos svc name
|
|
||||||
- name: NACOS_PORT
|
|
||||||
value: "8848"
|
|
||||||
- name: NACOS_SHARED_CONFIGS
|
|
||||||
value: application-dev.yml
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-gateway # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-gateway
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
||||||
selector:
|
|
||||||
app: ruoyi-gateway # The service exposes Pods with label `app=ruoyi-gateway`
|
|
||||||
ports: # Forward incoming connections on port 8080 to the target port 8080
|
|
||||||
- name: http
|
|
||||||
port: 8080
|
|
||||||
targetPort: 8080
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
apiVersion: apps/v1 # API version
|
|
||||||
kind: Deployment # Type of kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-file # Name of the kubernetes resource
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-file
|
|
||||||
spec:
|
|
||||||
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
||||||
selector:
|
|
||||||
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
||||||
app: ruoyi-file
|
|
||||||
template: # Template for creating the pods in this deployment
|
|
||||||
metadata:
|
|
||||||
labels: # Labels that will be applied to each Pod in this deployment
|
|
||||||
app: ruoyi-file
|
|
||||||
spec: # Spec for the containers that will be run in the Pods
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-file-server
|
|
||||||
image: ruoyi-modules-file:3.6.2
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 9300 # The port that the container exposes
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
|
||||||
value: k8s
|
|
||||||
- name: SERVER_NAME
|
|
||||||
value: ruoyi-file
|
|
||||||
- name: NACOS_SERVER
|
|
||||||
value: ruoyi-nacos # nacos svc name
|
|
||||||
- name: NACOS_PORT
|
|
||||||
value: "8848"
|
|
||||||
- name: NACOS_SHARED_CONFIGS
|
|
||||||
value: application-dev.yml
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-file # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-file
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
||||||
selector:
|
|
||||||
app: ruoyi-file # The service exposes Pods with label `app=ruoyi-file`
|
|
||||||
ports: # Forward incoming connections on port 9300 to the target port 9300
|
|
||||||
- name: http
|
|
||||||
port: 9300
|
|
||||||
targetPort: 9300
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
apiVersion: apps/v1 # API version
|
|
||||||
kind: Deployment # Type of kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-gen # Name of the kubernetes resource
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-gen
|
|
||||||
spec:
|
|
||||||
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
||||||
selector:
|
|
||||||
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
||||||
app: ruoyi-gen
|
|
||||||
template: # Template for creating the pods in this deployment
|
|
||||||
metadata:
|
|
||||||
labels: # Labels that will be applied to each Pod in this deployment
|
|
||||||
app: ruoyi-gen
|
|
||||||
spec: # Spec for the containers that will be run in the Pods
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-gen-server
|
|
||||||
image: ruoyi-modules-gen:3.6.2
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 9202 # The port that the container exposes
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
|
||||||
value: k8s
|
|
||||||
- name: SERVER_NAME
|
|
||||||
value: ruoyi-gen
|
|
||||||
- name: NACOS_SERVER
|
|
||||||
value: ruoyi-nacos # nacos svc name
|
|
||||||
- name: NACOS_PORT
|
|
||||||
value: "8848"
|
|
||||||
- name: NACOS_SHARED_CONFIGS
|
|
||||||
value: application-dev.yml
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-gen # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-gen
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
||||||
selector:
|
|
||||||
app: ruoyi-gen # The service exposes Pods with label `app=ruoyi-gen`
|
|
||||||
ports: # Forward incoming connections on port 9202 to the target port 9202
|
|
||||||
- name: http
|
|
||||||
port: 9202
|
|
||||||
targetPort: 9202
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
apiVersion: apps/v1 # API version
|
|
||||||
kind: Deployment # Type of kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-job # Name of the kubernetes resource
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-job
|
|
||||||
spec:
|
|
||||||
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
||||||
selector:
|
|
||||||
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
||||||
app: ruoyi-job
|
|
||||||
template: # Template for creating the pods in this deployment
|
|
||||||
metadata:
|
|
||||||
labels: # Labels that will be applied to each Pod in this deployment
|
|
||||||
app: ruoyi-job
|
|
||||||
spec: # Spec for the containers that will be run in the Pods
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-job-server
|
|
||||||
image: ruoyi-modules-job:3.6.2
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 9203 # The port that the container exposes
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
|
||||||
value: k8s
|
|
||||||
- name: SERVER_NAME
|
|
||||||
value: ruoyi-job
|
|
||||||
- name: NACOS_SERVER
|
|
||||||
value: ruoyi-nacos # nacos svc name
|
|
||||||
- name: NACOS_PORT
|
|
||||||
value: "8848"
|
|
||||||
- name: NACOS_SHARED_CONFIGS
|
|
||||||
value: application-dev.yml
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-job # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-job
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
||||||
selector:
|
|
||||||
app: ruoyi-job # The service exposes Pods with label `app=ruoyi-job`
|
|
||||||
ports: # Forward incoming connections on port 9203 to the target port 9203
|
|
||||||
- name: http
|
|
||||||
port: 9203
|
|
||||||
targetPort: 9203
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
apiVersion: apps/v1 # API version
|
|
||||||
kind: Deployment # Type of kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-system # Name of the kubernetes resource
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-system
|
|
||||||
spec:
|
|
||||||
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
||||||
selector:
|
|
||||||
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
||||||
app: ruoyi-system
|
|
||||||
template: # Template for creating the pods in this deployment
|
|
||||||
metadata:
|
|
||||||
labels: # Labels that will be applied to each Pod in this deployment
|
|
||||||
app: ruoyi-system
|
|
||||||
spec: # Spec for the containers that will be run in the Pods
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-system-server
|
|
||||||
image: ruoyi-modules-system:3.6.2
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 9201 # The port that the container exposes
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
|
||||||
value: k8s
|
|
||||||
- name: SERVER_NAME
|
|
||||||
value: ruoyi-system
|
|
||||||
- name: NACOS_SERVER
|
|
||||||
value: ruoyi-nacos # nacos svc name
|
|
||||||
- name: NACOS_PORT
|
|
||||||
value: "8848"
|
|
||||||
- name: NACOS_SHARED_CONFIGS
|
|
||||||
value: application-dev.yml
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-system # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-system
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
||||||
selector:
|
|
||||||
app: ruoyi-system # The service exposes Pods with label `app=ruoyi-system`
|
|
||||||
ports: # Forward incoming connections on port 9201 to the target port 9201
|
|
||||||
- name: http
|
|
||||||
port: 9201
|
|
||||||
targetPort: 9201
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
apiVersion: apps/v1 # API version
|
|
||||||
kind: Deployment # Type of kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-monitor # Name of the kubernetes resource
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-monitor
|
|
||||||
spec:
|
|
||||||
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
||||||
selector:
|
|
||||||
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
||||||
app: ruoyi-monitor
|
|
||||||
template: # Template for creating the pods in this deployment
|
|
||||||
metadata:
|
|
||||||
labels: # Labels that will be applied to each Pod in this deployment
|
|
||||||
app: ruoyi-monitor
|
|
||||||
spec: # Spec for the containers that will be run in the Pods
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-monitor-server
|
|
||||||
image: ruoyi-visual-monitor:3.6.2
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 9100 # The port that the container exposes
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
|
||||||
value: k8s
|
|
||||||
- name: SERVER_NAME
|
|
||||||
value: ruoyi-monitor
|
|
||||||
- name: NACOS_SERVER
|
|
||||||
value: ruoyi-nacos # nacos svc name
|
|
||||||
- name: NACOS_PORT
|
|
||||||
value: "8848"
|
|
||||||
- name: NACOS_SHARED_CONFIGS
|
|
||||||
value: application-dev.yml
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-monitor # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-monitor
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
||||||
selector:
|
|
||||||
app: ruoyi-monitor # The service exposes Pods with label `app=ruoyi-monitor`
|
|
||||||
ports: # Forward incoming connections on port 9100 to the target port 9100
|
|
||||||
- name: http
|
|
||||||
port: 9100
|
|
||||||
targetPort: 9100
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 8080
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: ${SERVER_NAME}
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- ${NACOS_SHARED_CONFIGS}
|
|
||||||
sentinel:
|
|
||||||
# 取消控制台懒加载
|
|
||||||
eager: true
|
|
||||||
transport:
|
|
||||||
# 控制台地址
|
|
||||||
dashboard: 127.0.0.1:8718
|
|
||||||
# nacos配置持久化
|
|
||||||
datasource:
|
|
||||||
ds1:
|
|
||||||
nacos:
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
dataId: sentinel-ruoyi-gateway
|
|
||||||
groupId: DEFAULT_GROUP
|
|
||||||
data-type: json
|
|
||||||
rule-type: gw-flow
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# 基础镜像
|
|
||||||
FROM openjdk:8-jre
|
|
||||||
# author
|
|
||||||
MAINTAINER ruoyi
|
|
||||||
|
|
||||||
# 挂载目录
|
|
||||||
VOLUME /home/ruoyi
|
|
||||||
# 创建目录
|
|
||||||
RUN mkdir -p /home/ruoyi
|
|
||||||
# 指定路径
|
|
||||||
WORKDIR /home/ruoyi
|
|
||||||
# 复制jar文件到路径
|
|
||||||
COPY ./jar/ruoyi-gateway.jar /home/ruoyi/ruoyi-gateway.jar
|
|
||||||
# 启动网关服务
|
|
||||||
ENTRYPOINT ["java","-jar","ruoyi-gateway.jar"]
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
存放网关模块打包好的jar文件,用于docker启动应用。
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
apiVersion: apps/v1 # API version
|
|
||||||
kind: Deployment # Type of kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-system # Name of the kubernetes resource
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-system
|
|
||||||
spec:
|
|
||||||
replicas: 1 # No. of replicas/pods to run in this deployment
|
|
||||||
selector:
|
|
||||||
matchLabels: # The deployment applies to any pods matching the specified labels
|
|
||||||
app: ruoyi-system
|
|
||||||
template: # Template for creating the pods in this deployment
|
|
||||||
metadata:
|
|
||||||
labels: # Labels that will be applied to each Pod in this deployment
|
|
||||||
app: ruoyi-system
|
|
||||||
spec: # Spec for the containers that will be run in the Pods
|
|
||||||
containers:
|
|
||||||
- name: ruoyi-system-server
|
|
||||||
image: ruoyi-modules-system:3.6.2
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: 9201 # The port that the container exposes
|
|
||||||
env: # Environment variables supplied to the Pod
|
|
||||||
- name: SPRING_PROFILES_ACTIVE
|
|
||||||
value: k8s
|
|
||||||
- name: SERVER_NAME
|
|
||||||
value: ruoyi-system
|
|
||||||
- name: NACOS_SERVER
|
|
||||||
value: ruoyi-nacos # nacos svc name
|
|
||||||
- name: NACOS_PORT
|
|
||||||
value: "8848"
|
|
||||||
- name: NACOS_SHARED_CONFIGS
|
|
||||||
value: application-dev.yml
|
|
||||||
- name: JAVA_OPTS
|
|
||||||
value: -javaagent:/javaagent/skywalking-agent/skywalking-agent.jar -Dskywalking.agent.service_name=k8s::$(SERVER_NAME) -Dskywalking.collector.backend_service=skywalking:11800
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /javaagent
|
|
||||||
name: agent-jar
|
|
||||||
volumes:
|
|
||||||
- emptyDir: { }
|
|
||||||
name: agent-jar
|
|
||||||
initContainers:
|
|
||||||
# 官网用脚本命令行+args的方式执行多条command语句
|
|
||||||
- command: ['sh']
|
|
||||||
args:
|
|
||||||
- "-c"
|
|
||||||
- |
|
|
||||||
cp -r /opt/skywalking-agent /javaagent
|
|
||||||
chown -R 65534:65534 /javaagent
|
|
||||||
/bin/chmod -R 777 /javaagent
|
|
||||||
image: skywalking-agent:8.14.0
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
name: skywalking-agent
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /javaagent
|
|
||||||
name: agent-jar
|
|
||||||
---
|
|
||||||
apiVersion: v1 # API version
|
|
||||||
kind: Service # Type of the kubernetes resource
|
|
||||||
metadata:
|
|
||||||
name: ruoyi-system # Name of the kubernetes resource
|
|
||||||
labels: # Labels that will be applied to this resource
|
|
||||||
app: ruoyi-system
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
type: NodePort # The service will be exposed by opening a Port on each node and proxying it.
|
|
||||||
selector:
|
|
||||||
app: ruoyi-system # The service exposes Pods with label `app=ruoyi-system`
|
|
||||||
ports: # Forward incoming connections on port 9201 to the target port 9201
|
|
||||||
- name: http
|
|
||||||
port: 9201
|
|
||||||
targetPort: 9201
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
## cat Dcokerfile
|
|
||||||
|
|
||||||
FROM docker.io/library/busybox:latest AS base
|
|
||||||
|
|
||||||
# 使用 ADD 下载 java-agent,你也可以使用其他下载命令,或者下载到本地,再 使用 COPY或者ADD 指令添加到 镜像里
|
|
||||||
ADD https://dlcdn.apache.org/skywalking/java-agent/9.0.0/apache-skywalking-java-agent-9.0.0.tgz /tmp/
|
|
||||||
RUN mkdir -p /opt \
|
|
||||||
&& tar -xzf /tmp/apache-skywalking-java-agent-9.0.0.tgz -C /opt/ \
|
|
||||||
&& rm -rf /tmp/*
|
|
||||||
#ADD skywalking-agent.tar.gz /opt/
|
|
||||||
RUN mkdir -p /javaagent
|
|
||||||
|
|
||||||
## java-agent 使用 方法
|
|
||||||
## https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/readme/
|
|
||||||
## java -javaagent:/opt/skywalking-agent/skywalking-agent.jar -jar yourApp.jar
|
|
||||||
## -javaagent:/opt/skywalking-agent/skywalking-agent.jar=agent.service_name=yourAppName,collector.backend_service=127.0.0.1:11800
|
|
||||||
## -javaagent:/opt/skywalking-agent/skywalking-agent.jar -Dskywalking.agent.service_name=yourAppName -Dskywalking.collector.backend_service=127.0.0.1:11800
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
name: elasticsearch
|
|
||||||
name: elasticsearch
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: elasticsearch
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: elasticsearch
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: elasticsearch
|
|
||||||
image: elasticsearch:7.14.2
|
|
||||||
ports:
|
|
||||||
- containerPort: 9200
|
|
||||||
name: cluster-node
|
|
||||||
env:
|
|
||||||
- name: discovery.type
|
|
||||||
value: single-node
|
|
||||||
- name: TZ
|
|
||||||
value: Asia/Shanghai
|
|
||||||
- name: ES_JAVA_OPTS
|
|
||||||
value: -Xms512m -Xmx512m
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: elasticsearch
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 9220 # 和auth-server的端口冲突了,对外暴露换一个端口访问
|
|
||||||
targetPort: 9200
|
|
||||||
name: cluster-node
|
|
||||||
selector:
|
|
||||||
app: elasticsearch # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上(targetPort:容器接收流量的端口;port:可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
|
|
||||||
type: NodePort
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
name: skywalking
|
|
||||||
name: skywalking
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: skywalking
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: skywalking
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: skywalking
|
|
||||||
image: apache/skywalking-oap-server
|
|
||||||
imagePullPolicy: Always
|
|
||||||
ports:
|
|
||||||
- containerPort: 11800
|
|
||||||
name: collector
|
|
||||||
- containerPort: 12800
|
|
||||||
name: oap
|
|
||||||
env:
|
|
||||||
- name: SW_STORAGE
|
|
||||||
value: elasticsearch
|
|
||||||
- name: TZ
|
|
||||||
value: Asia/Shanghai
|
|
||||||
- name: SW_STORAGE_ES_CLUSTER_NODES
|
|
||||||
value: elasticsearch:9220
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: skywalking
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 11800
|
|
||||||
targetPort: 11800
|
|
||||||
name: collector
|
|
||||||
- port: 12800
|
|
||||||
targetPort: 12800
|
|
||||||
name: oap
|
|
||||||
selector:
|
|
||||||
app: skywalking # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上(targetPort:容器接收流量的端口;port:可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
|
|
||||||
type: NodePort
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
name: skywalking-ui
|
|
||||||
name: skywalking-ui
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: skywalking-ui
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: skywalking-ui
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: skywalking-ui
|
|
||||||
image: apache/skywalking-ui
|
|
||||||
imagePullPolicy: Always
|
|
||||||
ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: console
|
|
||||||
env:
|
|
||||||
- name: SW_OAP_ADDRESS
|
|
||||||
value: http://skywalking:12800
|
|
||||||
- name: TZ
|
|
||||||
value: Asia/Shanghai
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: skywalking-ui
|
|
||||||
namespace: kube-ruoyi
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 8080
|
|
||||||
nodePort: 30088
|
|
||||||
selector:
|
|
||||||
app: skywalking-ui # 该 Service 会将所有具有标签 app: mysql-labels-app暴露到一个抽象的 Service 端口上(targetPort:容器接收流量的端口;port:可任意取值的抽象的 Service 端口,其他 Pod 通过该端口访问 Service
|
|
||||||
type: NodePort
|
|
||||||
@@ -9,7 +9,7 @@ usage() {
|
|||||||
|
|
||||||
# copy sql
|
# copy sql
|
||||||
echo "begin copy sql "
|
echo "begin copy sql "
|
||||||
cp ../sql/ry_20240629.sql ./mysql/db
|
cp ../sql/ry_20250523.sql ./mysql/db
|
||||||
cp ../sql/ry_config_20250224.sql ./mysql/db
|
cp ../sql/ry_config_20250224.sql ./mysql/db
|
||||||
|
|
||||||
# copy html
|
# copy html
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ http {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# 避免actuator暴露
|
# 避免actuator暴露
|
||||||
if ($request_uri ~ "/actuator") {
|
if ($uri ~ "/actuator") {
|
||||||
return 403;
|
return 403;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
pom.xml
11
pom.xml
@@ -6,14 +6,14 @@
|
|||||||
|
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
|
|
||||||
<name>ruoyi</name>
|
<name>ruoyi</name>
|
||||||
<url>http://www.ruoyi.vip</url>
|
<url>http://www.ruoyi.vip</url>
|
||||||
<description>若依微服务系统</description>
|
<description>若依微服务系统</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<ruoyi.version>3.6.5</ruoyi.version>
|
<ruoyi.version>3.6.6</ruoyi.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
@@ -26,17 +26,16 @@
|
|||||||
<pagehelper.boot.version>2.0.0</pagehelper.boot.version>
|
<pagehelper.boot.version>2.0.0</pagehelper.boot.version>
|
||||||
<druid.version>1.2.23</druid.version>
|
<druid.version>1.2.23</druid.version>
|
||||||
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||||
<commons.io.version>2.13.0</commons.io.version>
|
<commons.io.version>2.19.0</commons.io.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<fastjson.version>2.0.53</fastjson.version>
|
<fastjson.version>2.0.57</fastjson.version>
|
||||||
<jjwt.version>0.9.1</jjwt.version>
|
<jjwt.version>0.9.1</jjwt.version>
|
||||||
<minio.version>8.2.2</minio.version>
|
<minio.version>8.2.2</minio.version>
|
||||||
<poi.version>4.1.2</poi.version>
|
<poi.version>4.1.2</poi.version>
|
||||||
<springdoc.version>1.6.9</springdoc.version>
|
<springdoc.version>1.6.9</springdoc.version>
|
||||||
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
|
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
|
||||||
|
|
||||||
<!-- override dependency version -->
|
<!-- override dependency version -->
|
||||||
<tomcat.version>9.0.96</tomcat.version>
|
<tomcat.version>9.0.105</tomcat.version>
|
||||||
<logback.version>1.2.13</logback.version>
|
<logback.version>1.2.13</logback.version>
|
||||||
<spring-framework.version>5.3.39</spring-framework.version>
|
<spring-framework.version>5.3.39</spring-framework.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-api</artifactId>
|
<artifactId>ruoyi-api</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
import com.ruoyi.common.core.annotation.Excel.ColumnType;
|
import com.ruoyi.common.core.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.core.annotation.Excel.Type;
|
import com.ruoyi.common.core.annotation.Excel.Type;
|
||||||
|
import com.ruoyi.common.core.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.annotation.Excels;
|
import com.ruoyi.common.core.annotation.Excels;
|
||||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
import com.ruoyi.common.core.xss.Xss;
|
import com.ruoyi.common.core.xss.Xss;
|
||||||
@@ -55,8 +56,8 @@ public class SysUser extends BaseEntity
|
|||||||
/** 密码 */
|
/** 密码 */
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/** 帐号状态(0正常 1停用) */
|
/** 账号状态(0正常 1停用) */
|
||||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "账号状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
@@ -70,6 +71,9 @@ public class SysUser extends BaseEntity
|
|||||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||||
private Date loginDate;
|
private Date loginDate;
|
||||||
|
|
||||||
|
/** 密码最后更新时间 */
|
||||||
|
private Date pwdUpdateDate;
|
||||||
|
|
||||||
/** 部门对象 */
|
/** 部门对象 */
|
||||||
@Excels({
|
@Excels({
|
||||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||||
@@ -116,7 +120,7 @@ public class SysUser extends BaseEntity
|
|||||||
|
|
||||||
public static boolean isAdmin(Long userId)
|
public static boolean isAdmin(Long userId)
|
||||||
{
|
{
|
||||||
return userId != null && 1L == userId;
|
return UserConstants.isAdmin(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDeptId()
|
public Long getDeptId()
|
||||||
@@ -247,6 +251,16 @@ public class SysUser extends BaseEntity
|
|||||||
this.loginDate = loginDate;
|
this.loginDate = loginDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getPwdUpdateDate()
|
||||||
|
{
|
||||||
|
return pwdUpdateDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPwdUpdateDate(Date pwdUpdateDate)
|
||||||
|
{
|
||||||
|
this.pwdUpdateDate = pwdUpdateDate;
|
||||||
|
}
|
||||||
|
|
||||||
public SysDept getDept()
|
public SysDept getDept()
|
||||||
{
|
{
|
||||||
return dept;
|
return dept;
|
||||||
@@ -296,6 +310,7 @@ public class SysUser extends BaseEntity
|
|||||||
{
|
{
|
||||||
this.roleId = roleId;
|
this.roleId = roleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
@@ -312,6 +327,7 @@ public class SysUser extends BaseEntity
|
|||||||
.append("delFlag", getDelFlag())
|
.append("delFlag", getDelFlag())
|
||||||
.append("loginIp", getLoginIp())
|
.append("loginIp", getLoginIp())
|
||||||
.append("loginDate", getLoginDate())
|
.append("loginDate", getLoginDate())
|
||||||
|
.append("pwdUpdateDate", getPwdUpdateDate())
|
||||||
.append("createBy", getCreateBy())
|
.append("createBy", getCreateBy())
|
||||||
.append("createTime", getCreateTime())
|
.append("createTime", getCreateTime())
|
||||||
.append("updateBy", getUpdateBy())
|
.append("updateBy", getUpdateBy())
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public class SysLoginService
|
|||||||
SysUser sysUser = new SysUser();
|
SysUser sysUser = new SysUser();
|
||||||
sysUser.setUserName(username);
|
sysUser.setUserName(username);
|
||||||
sysUser.setNickName(username);
|
sysUser.setNickName(username);
|
||||||
|
sysUser.setPwdUpdateDate(DateUtils.getNowDate());
|
||||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
R<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
R<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 9200
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: ${SERVER_NAME}
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- ${NACOS_SHARED_CONFIGS}
|
|
||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
name: ruoyi-auth
|
name: ruoyi-auth
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: ${SPRING_PROFILES_ACTIVE:dev}
|
active: dev
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -80,4 +80,9 @@ public class UserConstants
|
|||||||
public static final int PASSWORD_MIN_LENGTH = 5;
|
public static final int PASSWORD_MIN_LENGTH = 5;
|
||||||
|
|
||||||
public static final int PASSWORD_MAX_LENGTH = 20;
|
public static final int PASSWORD_MAX_LENGTH = 20;
|
||||||
|
|
||||||
|
public static boolean isAdmin(Long userId)
|
||||||
|
{
|
||||||
|
return userId != null && 1L == userId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -540,9 +540,9 @@ public class Convert
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 转换为boolean<br>
|
* 转换为boolean<br>
|
||||||
* String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
|
* String支持的值为:true、false、yes、ok、no、1、0、是、否, 如果给定的值为空,或者转换失败,返回默认值<br>
|
||||||
* 转换失败不会报错
|
* 转换失败不会报错
|
||||||
*
|
*
|
||||||
* @param value 被转换的值
|
* @param value 被转换的值
|
||||||
* @param defaultValue 转换错误时的默认值
|
* @param defaultValue 转换错误时的默认值
|
||||||
* @return 结果
|
* @return 结果
|
||||||
@@ -569,10 +569,12 @@ public class Convert
|
|||||||
case "yes":
|
case "yes":
|
||||||
case "ok":
|
case "ok":
|
||||||
case "1":
|
case "1":
|
||||||
|
case "是":
|
||||||
return true;
|
return true;
|
||||||
case "false":
|
case "false":
|
||||||
case "no":
|
case "no":
|
||||||
case "0":
|
case "0":
|
||||||
|
case "否":
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
|
|||||||
@@ -136,6 +136,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||||||
return new Date(time);
|
return new Date(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算相差天数
|
||||||
|
*/
|
||||||
|
public static int differentDaysByMillisecond(Date date1, Date date2)
|
||||||
|
{
|
||||||
|
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算时间差
|
* 计算时间差
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -283,6 +283,32 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||||||
return str.substring(start, end);
|
return str.substring(start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在字符串中查找第一个出现的 `open` 和最后一个出现的 `close` 之间的子字符串
|
||||||
|
*
|
||||||
|
* @param str 要截取的字符串
|
||||||
|
* @param open 起始字符串
|
||||||
|
* @param close 结束字符串
|
||||||
|
* @return 截取结果
|
||||||
|
*/
|
||||||
|
public static String substringBetweenLast(final String str, final String open, final String close)
|
||||||
|
{
|
||||||
|
if (isEmpty(str) || isEmpty(open) || isEmpty(close))
|
||||||
|
{
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
final int start = str.indexOf(open);
|
||||||
|
if (start != INDEX_NOT_FOUND)
|
||||||
|
{
|
||||||
|
final int end = str.lastIndexOf(close);
|
||||||
|
if (end != INDEX_NOT_FOUND)
|
||||||
|
{
|
||||||
|
return str.substring(start + open.length(), end);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULLSTR;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否为空,并且不是空白字符
|
* 判断是否为空,并且不是空白字符
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ public class ExcelUtil<T>
|
|||||||
if (String.class == fieldType)
|
if (String.class == fieldType)
|
||||||
{
|
{
|
||||||
String s = Convert.toStr(val);
|
String s = Convert.toStr(val);
|
||||||
if (StringUtils.endsWith(s, ".0"))
|
if (s.matches("^\\d+\\.0$"))
|
||||||
{
|
{
|
||||||
val = StringUtils.substringBefore(s, ".0");
|
val = StringUtils.substringBefore(s, ".0");
|
||||||
}
|
}
|
||||||
@@ -1000,6 +1000,7 @@ public class ExcelUtil<T>
|
|||||||
String separator = attr.separator();
|
String separator = attr.separator();
|
||||||
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
|
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
|
||||||
{
|
{
|
||||||
|
cell.getCellStyle().setDataFormat(this.wb.getCreationHelper().createDataFormat().getFormat(dateFormat));
|
||||||
cell.setCellValue(parseDateToStr(dateFormat, value));
|
cell.setCellValue(parseDateToStr(dateFormat, value));
|
||||||
}
|
}
|
||||||
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
|
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
|
||||||
|
|||||||
@@ -343,25 +343,25 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
|
|||||||
final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
|
final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
|
||||||
// time_low
|
// time_low
|
||||||
builder.append(digits(mostSigBits >> 32, 8));
|
builder.append(digits(mostSigBits >> 32, 8));
|
||||||
if (false == isSimple)
|
if (!isSimple)
|
||||||
{
|
{
|
||||||
builder.append('-');
|
builder.append('-');
|
||||||
}
|
}
|
||||||
// time_mid
|
// time_mid
|
||||||
builder.append(digits(mostSigBits >> 16, 4));
|
builder.append(digits(mostSigBits >> 16, 4));
|
||||||
if (false == isSimple)
|
if (!isSimple)
|
||||||
{
|
{
|
||||||
builder.append('-');
|
builder.append('-');
|
||||||
}
|
}
|
||||||
// time_high_and_version
|
// time_high_and_version
|
||||||
builder.append(digits(mostSigBits, 4));
|
builder.append(digits(mostSigBits, 4));
|
||||||
if (false == isSimple)
|
if (!isSimple)
|
||||||
{
|
{
|
||||||
builder.append('-');
|
builder.append('-');
|
||||||
}
|
}
|
||||||
// variant_and_sequence
|
// variant_and_sequence
|
||||||
builder.append(digits(leastSigBits >> 48, 4));
|
builder.append(digits(leastSigBits >> 48, 4));
|
||||||
if (false == isSimple)
|
if (!isSimple)
|
||||||
{
|
{
|
||||||
builder.append('-');
|
builder.append('-');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,17 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.web.bind.WebDataBinder;
|
import org.springframework.web.bind.WebDataBinder;
|
||||||
import org.springframework.web.bind.annotation.InitBinder;
|
import org.springframework.web.bind.annotation.InitBinder;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ruoyi.common.core.constant.HttpStatus;
|
import com.ruoyi.common.core.constant.HttpStatus;
|
||||||
import com.ruoyi.common.core.utils.DateUtils;
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
import com.ruoyi.common.core.utils.PageUtils;
|
import com.ruoyi.common.core.utils.PageUtils;
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.utils.sql.SqlUtil;
|
||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.web.page.PageDomain;
|
||||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.web.page.TableSupport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web层通用数据处理
|
* web层通用数据处理
|
||||||
@@ -48,6 +53,19 @@ public class BaseController
|
|||||||
PageUtils.startPage();
|
PageUtils.startPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置请求排序数据
|
||||||
|
*/
|
||||||
|
protected void startOrderBy()
|
||||||
|
{
|
||||||
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
|
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
|
||||||
|
{
|
||||||
|
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||||
|
PageHelper.orderBy(orderBy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清理分页的线程变量
|
* 清理分页的线程变量
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class TableDataInfo implements Serializable
|
|||||||
* @param list 列表数据
|
* @param list 列表数据
|
||||||
* @param total 总记录数
|
* @param total 总记录数
|
||||||
*/
|
*/
|
||||||
public TableDataInfo(List<?> list, int total)
|
public TableDataInfo(List<?> list, long total)
|
||||||
{
|
{
|
||||||
this.rows = list;
|
this.rows = list;
|
||||||
this.total = total;
|
this.total = total;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import org.springframework.stereotype.Component;
|
|||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.core.utils.ExceptionUtil;
|
||||||
import com.ruoyi.common.core.utils.ServletUtils;
|
import com.ruoyi.common.core.utils.ServletUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.utils.ip.IpUtils;
|
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||||
@@ -53,7 +55,7 @@ public class LogAspect
|
|||||||
* 处理请求前执行
|
* 处理请求前执行
|
||||||
*/
|
*/
|
||||||
@Before(value = "@annotation(controllerLog)")
|
@Before(value = "@annotation(controllerLog)")
|
||||||
public void boBefore(JoinPoint joinPoint, Log controllerLog)
|
public void doBefore(JoinPoint joinPoint, Log controllerLog)
|
||||||
{
|
{
|
||||||
TIME_THREADLOCAL.set(System.currentTimeMillis());
|
TIME_THREADLOCAL.set(System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
@@ -101,7 +103,7 @@ public class LogAspect
|
|||||||
if (e != null)
|
if (e != null)
|
||||||
{
|
{
|
||||||
operLog.setStatus(BusinessStatus.FAIL.ordinal());
|
operLog.setStatus(BusinessStatus.FAIL.ordinal());
|
||||||
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
|
operLog.setErrorMsg(StringUtils.substring(Convert.toStr(e.getMessage(), ExceptionUtil.getExceptionMessage(e)), 0, 2000));
|
||||||
}
|
}
|
||||||
// 设置方法名称
|
// 设置方法名称
|
||||||
String className = joinPoint.getTarget().getClass().getName();
|
String className = joinPoint.getTarget().getClass().getName();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -56,16 +56,8 @@ public class PreAuthorizeAspect
|
|||||||
// 注解鉴权
|
// 注解鉴权
|
||||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||||
checkMethodAnnotation(signature.getMethod());
|
checkMethodAnnotation(signature.getMethod());
|
||||||
try
|
// 执行原有逻辑
|
||||||
{
|
return joinPoint.proceed();
|
||||||
// 执行原有逻辑
|
|
||||||
Object obj = joinPoint.proceed();
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
catch (Throwable e)
|
|
||||||
{
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ public class TokenService
|
|||||||
|
|
||||||
protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
|
protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
|
||||||
|
|
||||||
private final static long expireTime = CacheConstants.EXPIRATION;
|
private final static long TOKEN_EXPIRE_TIME = CacheConstants.EXPIRATION;
|
||||||
|
|
||||||
private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
|
private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
|
||||||
|
|
||||||
private final static Long MILLIS_MINUTE_TEN = CacheConstants.REFRESH_TIME * MILLIS_MINUTE;
|
private final static Long TOKEN_REFRESH_THRESHOLD_MINUTES = CacheConstants.REFRESH_TIME * MILLIS_MINUTE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建令牌
|
* 创建令牌
|
||||||
@@ -65,7 +65,7 @@ public class TokenService
|
|||||||
// 接口返回信息
|
// 接口返回信息
|
||||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
Map<String, Object> rspMap = new HashMap<String, Object>();
|
||||||
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
||||||
rspMap.put("expires_in", expireTime);
|
rspMap.put("expires_in", TOKEN_EXPIRE_TIME);
|
||||||
return rspMap;
|
return rspMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ public class TokenService
|
|||||||
{
|
{
|
||||||
long expireTime = loginUser.getExpireTime();
|
long expireTime = loginUser.getExpireTime();
|
||||||
long currentTime = System.currentTimeMillis();
|
long currentTime = System.currentTimeMillis();
|
||||||
if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
|
if (expireTime - currentTime <= TOKEN_REFRESH_THRESHOLD_MINUTES)
|
||||||
{
|
{
|
||||||
refreshToken(loginUser);
|
refreshToken(loginUser);
|
||||||
}
|
}
|
||||||
@@ -161,10 +161,10 @@ public class TokenService
|
|||||||
public void refreshToken(LoginUser loginUser)
|
public void refreshToken(LoginUser loginUser)
|
||||||
{
|
{
|
||||||
loginUser.setLoginTime(System.currentTimeMillis());
|
loginUser.setLoginTime(System.currentTimeMillis());
|
||||||
loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
|
loginUser.setExpireTime(loginUser.getLoginTime() + TOKEN_EXPIRE_TIME * MILLIS_MINUTE);
|
||||||
// 根据uuid将loginUser缓存
|
// 根据uuid将loginUser缓存
|
||||||
String userKey = getTokenKey(loginUser.getToken());
|
String userKey = getTokenKey(loginUser.getToken());
|
||||||
redisService.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
|
redisService.setCacheObject(userKey, loginUser, TOKEN_EXPIRE_TIME, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getTokenKey(String token)
|
private String getTokenKey(String token)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- RuoYi Common Security -->
|
<!-- RuoYi Common Core -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-security</artifactId>
|
<artifactId>ruoyi-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import com.fasterxml.jackson.databind.JsonMappingException;
|
|||||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
|
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
|
||||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.common.core.constant.UserConstants;
|
||||||
|
import com.ruoyi.common.core.context.SecurityContextHolder;
|
||||||
import com.ruoyi.common.sensitive.annotation.Sensitive;
|
import com.ruoyi.common.sensitive.annotation.Sensitive;
|
||||||
import com.ruoyi.common.sensitive.enums.DesensitizedType;
|
import com.ruoyi.common.sensitive.enums.DesensitizedType;
|
||||||
import com.ruoyi.system.api.model.LoginUser;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据脱敏序列化过滤
|
* 数据脱敏序列化过滤
|
||||||
@@ -55,9 +55,9 @@ public class SensitiveJsonSerializer extends JsonSerializer<String> implements C
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LoginUser securityUser = SecurityUtils.getLoginUser();
|
Long userId = SecurityContextHolder.getUserId();
|
||||||
// 管理员不脱敏
|
// 管理员不脱敏
|
||||||
return !securityUser.getSysUser().isAdmin();
|
return !UserConstants.isAdmin(userId);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
package com.ruoyi.gateway.filter;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.cloud.gateway.filter.GatewayFilter;
|
|
||||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
|
||||||
import org.springframework.cloud.gateway.filter.OrderedGatewayFilter;
|
|
||||||
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
|
|
||||||
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
|
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
|
||||||
import reactor.core.publisher.Mono;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取body请求数据(解决流不能重复读取问题)
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class CacheRequestFilter extends AbstractGatewayFilterFactory<CacheRequestFilter.Config>
|
|
||||||
{
|
|
||||||
public CacheRequestFilter()
|
|
||||||
{
|
|
||||||
super(Config.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String name()
|
|
||||||
{
|
|
||||||
return "CacheRequestFilter";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GatewayFilter apply(Config config)
|
|
||||||
{
|
|
||||||
CacheRequestGatewayFilter cacheRequestGatewayFilter = new CacheRequestGatewayFilter();
|
|
||||||
Integer order = config.getOrder();
|
|
||||||
if (order == null)
|
|
||||||
{
|
|
||||||
return cacheRequestGatewayFilter;
|
|
||||||
}
|
|
||||||
return new OrderedGatewayFilter(cacheRequestGatewayFilter, order);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class CacheRequestGatewayFilter implements GatewayFilter
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain)
|
|
||||||
{
|
|
||||||
// GET DELETE 不过滤
|
|
||||||
HttpMethod method = exchange.getRequest().getMethod();
|
|
||||||
if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE)
|
|
||||||
{
|
|
||||||
return chain.filter(exchange);
|
|
||||||
}
|
|
||||||
return ServerWebExchangeUtils.cacheRequestBodyAndRequest(exchange, (serverHttpRequest) -> {
|
|
||||||
if (serverHttpRequest == exchange.getRequest())
|
|
||||||
{
|
|
||||||
return chain.filter(exchange);
|
|
||||||
}
|
|
||||||
return chain.filter(exchange.mutate().request(serverHttpRequest).build());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> shortcutFieldOrder()
|
|
||||||
{
|
|
||||||
return Collections.singletonList("order");
|
|
||||||
}
|
|
||||||
|
|
||||||
static class Config
|
|
||||||
{
|
|
||||||
private Integer order;
|
|
||||||
|
|
||||||
public Integer getOrder()
|
|
||||||
{
|
|
||||||
return order;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrder(Integer order)
|
|
||||||
{
|
|
||||||
this.order = order;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 8080
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: ${SERVER_NAME}
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- ${NACOS_SHARED_CONFIGS}
|
|
||||||
sentinel:
|
|
||||||
# 取消控制台懒加载
|
|
||||||
eager: true
|
|
||||||
transport:
|
|
||||||
# 控制台地址
|
|
||||||
dashboard: 127.0.0.1:8718
|
|
||||||
# nacos配置持久化
|
|
||||||
datasource:
|
|
||||||
ds1:
|
|
||||||
nacos:
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
dataId: sentinel-ruoyi-gateway
|
|
||||||
groupId: DEFAULT_GROUP
|
|
||||||
data-type: json
|
|
||||||
rule-type: gw-flow
|
|
||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
name: ruoyi-gateway
|
name: ruoyi-gateway
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: ${SPRING_PROFILES_ACTIVE:dev}
|
active: dev
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-modules</artifactId>
|
<artifactId>ruoyi-modules</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 9300
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: ${SERVER_NAME}
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- ${NACOS_SHARED_CONFIGS}
|
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
name: ruoyi-file
|
name: ruoyi-file
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: ${SPRING_PROFILES_ACTIVE:dev}
|
active: dev
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-modules</artifactId>
|
<artifactId>ruoyi-modules</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class GenController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改代码生成业务
|
* 获取代码生成信息
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("tool:gen:query")
|
@RequiresPermissions("tool:gen:query")
|
||||||
@GetMapping(value = "/{tableId}")
|
@GetMapping(value = "/{tableId}")
|
||||||
|
|||||||
@@ -129,9 +129,9 @@ public class GenTableServiceImpl implements IGenTableService
|
|||||||
int row = genTableMapper.updateGenTable(genTable);
|
int row = genTableMapper.updateGenTable(genTable);
|
||||||
if (row > 0)
|
if (row > 0)
|
||||||
{
|
{
|
||||||
for (GenTableColumn cenTableColumn : genTable.getColumns())
|
for (GenTableColumn genTableColumn : genTable.getColumns())
|
||||||
{
|
{
|
||||||
genTableColumnMapper.updateGenTableColumn(cenTableColumn);
|
genTableColumnMapper.updateGenTableColumn(genTableColumn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -414,16 +414,16 @@ public class GenTableServiceImpl implements IGenTableService
|
|||||||
{
|
{
|
||||||
throw new ServiceException("树名称字段不能为空");
|
throw new ServiceException("树名称字段不能为空");
|
||||||
}
|
}
|
||||||
else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
|
}
|
||||||
|
else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
|
||||||
|
{
|
||||||
|
if (StringUtils.isEmpty(genTable.getSubTableName()))
|
||||||
{
|
{
|
||||||
if (StringUtils.isEmpty(genTable.getSubTableName()))
|
throw new ServiceException("关联子表的表名不能为空");
|
||||||
{
|
}
|
||||||
throw new ServiceException("关联子表的表名不能为空");
|
else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
|
||||||
}
|
{
|
||||||
else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
|
throw new ServiceException("子表关联的外键名不能为空");
|
||||||
{
|
|
||||||
throw new ServiceException("子表关联的外键名不能为空");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 9202
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: ${SERVER_NAME}
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- ${NACOS_SHARED_CONFIGS}
|
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
name: ruoyi-gen
|
name: ruoyi-gen
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: ${SPRING_PROFILES_ACTIVE:dev}
|
active: dev
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
|||||||
@@ -71,9 +71,9 @@ public class ${ClassName} extends ${Entity}
|
|||||||
{
|
{
|
||||||
return $column.javaField;
|
return $column.javaField;
|
||||||
}
|
}
|
||||||
#end
|
|
||||||
#end
|
|
||||||
|
|
||||||
|
#end
|
||||||
|
#end
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
public List<${subClassName}> get${subClassName}List()
|
public List<${subClassName}> get${subClassName}List()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
v-hasPermi="['${permissionPrefix}:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -144,21 +144,21 @@
|
|||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
v-hasPermi="['${permissionPrefix}:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="handleAdd(scope.row)"
|
@click="handleAdd(scope.row)"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
v-hasPermi="['${permissionPrefix}:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
v-hasPermi="['${permissionPrefix}:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -283,9 +283,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect"
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "${BusinessName}",
|
name: "${BusinessName}",
|
||||||
@@ -346,18 +346,18 @@ export default {
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询${functionName}列表 */
|
/** 查询${functionName}列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
this.queryParams.params = {};
|
this.queryParams.params = {}
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
@@ -365,40 +365,40 @@ export default {
|
|||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
|
if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
|
||||||
this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0];
|
this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0]
|
||||||
this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1];
|
this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1]
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
list${BusinessName}(this.queryParams).then(response => {
|
list${BusinessName}(this.queryParams).then(response => {
|
||||||
this.${businessName}List = this.handleTree(response.data, "${treeCode}", "${treeParentCode}");
|
this.${businessName}List = this.handleTree(response.data, "${treeCode}", "${treeParentCode}")
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 转换${functionName}数据结构 */
|
/** 转换${functionName}数据结构 */
|
||||||
normalizer(node) {
|
normalizer(node) {
|
||||||
if (node.children && !node.children.length) {
|
if (node.children && !node.children.length) {
|
||||||
delete node.children;
|
delete node.children
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
id: node.${treeCode},
|
id: node.${treeCode},
|
||||||
label: node.${treeName},
|
label: node.${treeName},
|
||||||
children: node.children
|
children: node.children
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
/** 查询${functionName}下拉树结构 */
|
/** 查询${functionName}下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
list${BusinessName}().then(response => {
|
list${BusinessName}().then(response => {
|
||||||
this.${businessName}Options = [];
|
this.${businessName}Options = []
|
||||||
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] };
|
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] }
|
||||||
data.children = this.handleTree(response.data, "${treeCode}", "${treeParentCode}");
|
data.children = this.handleTree(response.data, "${treeCode}", "${treeParentCode}")
|
||||||
this.${businessName}Options.push(data);
|
this.${businessName}Options.push(data)
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.reset();
|
this.reset()
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
@@ -410,61 +410,61 @@ export default {
|
|||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
};
|
}
|
||||||
this.resetForm("form");
|
this.resetForm("form")
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
this.daterange${AttrName} = [];
|
this.daterange${AttrName} = []
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm")
|
||||||
this.handleQuery();
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd(row) {
|
handleAdd(row) {
|
||||||
this.reset();
|
this.reset()
|
||||||
this.getTreeselect();
|
this.getTreeselect()
|
||||||
if (row != null && row.${treeCode}) {
|
if (row != null && row.${treeCode}) {
|
||||||
this.form.${treeParentCode} = row.${treeCode};
|
this.form.${treeParentCode} = row.${treeCode}
|
||||||
} else {
|
} else {
|
||||||
this.form.${treeParentCode} = 0;
|
this.form.${treeParentCode} = 0
|
||||||
}
|
}
|
||||||
this.open = true;
|
this.open = true
|
||||||
this.title = "添加${functionName}";
|
this.title = "添加${functionName}"
|
||||||
},
|
},
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
toggleExpandAll() {
|
toggleExpandAll() {
|
||||||
this.refreshTable = false;
|
this.refreshTable = false
|
||||||
this.isExpandAll = !this.isExpandAll;
|
this.isExpandAll = !this.isExpandAll
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.refreshTable = true;
|
this.refreshTable = true
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset()
|
||||||
this.getTreeselect();
|
this.getTreeselect()
|
||||||
if (row != null) {
|
if (row != null) {
|
||||||
this.form.${treeParentCode} = row.${treeCode};
|
this.form.${treeParentCode} = row.${treeParentCode}
|
||||||
}
|
}
|
||||||
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
this.form.$column.javaField = this.form.${column.javaField}.split(",");
|
this.form.$column.javaField = this.form.${column.javaField}.split(",")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
this.open = true;
|
this.open = true
|
||||||
this.title = "修改${functionName}";
|
this.title = "修改${functionName}"
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
@@ -472,34 +472,34 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
this.form.$column.javaField = this.form.${column.javaField}.join(",");
|
this.form.$column.javaField = this.form.${column.javaField}.join(",")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
if (this.form.${pkColumn.javaField} != null) {
|
if (this.form.${pkColumn.javaField} != null) {
|
||||||
update${BusinessName}(this.form).then(response => {
|
update${BusinessName}(this.form).then(response => {
|
||||||
this.#[[$modal]]#.msgSuccess("修改成功");
|
this.#[[$modal]]#.msgSuccess("修改成功")
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.getList();
|
this.getList()
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
add${BusinessName}(this.form).then(response => {
|
add${BusinessName}(this.form).then(response => {
|
||||||
this.#[[$modal]]#.msgSuccess("新增成功");
|
this.#[[$modal]]#.msgSuccess("新增成功")
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.getList();
|
this.getList()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
||||||
return del${BusinessName}(row.${pkColumn.javaField});
|
return del${BusinessName}(row.${pkColumn.javaField})
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList()
|
||||||
this.#[[$modal]]#.msgSuccess("删除成功");
|
this.#[[$modal]]#.msgSuccess("删除成功")
|
||||||
}).catch(() => {});
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
v-hasPermi="['${permissionPrefix}:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
v-hasPermi="['${permissionPrefix}:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
v-hasPermi="['${permissionPrefix}:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
v-hasPermi="['${permissionPrefix}:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
@@ -158,14 +158,14 @@
|
|||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
v-hasPermi="['${permissionPrefix}:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
v-hasPermi="['${permissionPrefix}:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -353,7 +353,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "${BusinessName}",
|
name: "${BusinessName}",
|
||||||
@@ -423,18 +423,18 @@ export default {
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询${functionName}列表 */
|
/** 查询${functionName}列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
this.queryParams.params = {};
|
this.queryParams.params = {}
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
@@ -442,21 +442,21 @@ export default {
|
|||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
|
if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
|
||||||
this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0];
|
this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0]
|
||||||
this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1];
|
this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1]
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
list${BusinessName}(this.queryParams).then(response => {
|
list${BusinessName}(this.queryParams).then(response => {
|
||||||
this.${businessName}List = response.rows;
|
this.${businessName}List = response.rows
|
||||||
this.total = response.total;
|
this.total = response.total
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.reset();
|
this.reset()
|
||||||
},
|
},
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
@@ -468,27 +468,27 @@ export default {
|
|||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
};
|
}
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
this.${subclassName}List = [];
|
this.${subclassName}List = []
|
||||||
#end
|
#end
|
||||||
this.resetForm("form");
|
this.resetForm("form")
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
this.daterange${AttrName} = [];
|
this.daterange${AttrName} = []
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm")
|
||||||
this.handleQuery();
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
@@ -498,27 +498,27 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset()
|
||||||
this.open = true;
|
this.open = true
|
||||||
this.title = "添加${functionName}";
|
this.title = "添加${functionName}"
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset()
|
||||||
const ${pkColumn.javaField} = row.${pkColumn.javaField} || this.ids
|
const ${pkColumn.javaField} = row.${pkColumn.javaField} || this.ids
|
||||||
get${BusinessName}(${pkColumn.javaField}).then(response => {
|
get${BusinessName}(${pkColumn.javaField}).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
this.form.$column.javaField = this.form.${column.javaField}.split(",");
|
this.form.$column.javaField = this.form.${column.javaField}.split(",")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
this.${subclassName}List = response.data.${subclassName}List;
|
this.${subclassName}List = response.data.${subclassName}List
|
||||||
#end
|
#end
|
||||||
this.open = true;
|
this.open = true
|
||||||
this.title = "修改${functionName}";
|
this.title = "修改${functionName}"
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
@@ -526,64 +526,64 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
this.form.$column.javaField = this.form.${column.javaField}.join(",");
|
this.form.$column.javaField = this.form.${column.javaField}.join(",")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
this.form.${subclassName}List = this.${subclassName}List;
|
this.form.${subclassName}List = this.${subclassName}List
|
||||||
#end
|
#end
|
||||||
if (this.form.${pkColumn.javaField} != null) {
|
if (this.form.${pkColumn.javaField} != null) {
|
||||||
update${BusinessName}(this.form).then(response => {
|
update${BusinessName}(this.form).then(response => {
|
||||||
this.#[[$modal]]#.msgSuccess("修改成功");
|
this.#[[$modal]]#.msgSuccess("修改成功")
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.getList();
|
this.getList()
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
add${BusinessName}(this.form).then(response => {
|
add${BusinessName}(this.form).then(response => {
|
||||||
this.#[[$modal]]#.msgSuccess("新增成功");
|
this.#[[$modal]]#.msgSuccess("新增成功")
|
||||||
this.open = false;
|
this.open = false
|
||||||
this.getList();
|
this.getList()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
|
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids
|
||||||
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
|
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
|
||||||
return del${BusinessName}(${pkColumn.javaField}s);
|
return del${BusinessName}(${pkColumn.javaField}s)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList()
|
||||||
this.#[[$modal]]#.msgSuccess("删除成功");
|
this.#[[$modal]]#.msgSuccess("删除成功")
|
||||||
}).catch(() => {});
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
/** ${subTable.functionName}序号 */
|
/** ${subTable.functionName}序号 */
|
||||||
row${subClassName}Index({ row, rowIndex }) {
|
row${subClassName}Index({ row, rowIndex }) {
|
||||||
row.index = rowIndex + 1;
|
row.index = rowIndex + 1
|
||||||
},
|
},
|
||||||
/** ${subTable.functionName}添加按钮操作 */
|
/** ${subTable.functionName}添加按钮操作 */
|
||||||
handleAdd${subClassName}() {
|
handleAdd${subClassName}() {
|
||||||
let obj = {};
|
let obj = {}
|
||||||
#foreach($column in $subTable.columns)
|
#foreach($column in $subTable.columns)
|
||||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
||||||
#elseif($column.list && "" != $javaField)
|
#elseif($column.list && "" != $javaField)
|
||||||
obj.$column.javaField = "";
|
obj.$column.javaField = ""
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
this.${subclassName}List.push(obj);
|
this.${subclassName}List.push(obj)
|
||||||
},
|
},
|
||||||
/** ${subTable.functionName}删除按钮操作 */
|
/** ${subTable.functionName}删除按钮操作 */
|
||||||
handleDelete${subClassName}() {
|
handleDelete${subClassName}() {
|
||||||
if (this.checked${subClassName}.length == 0) {
|
if (this.checked${subClassName}.length == 0) {
|
||||||
this.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
|
this.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据")
|
||||||
} else {
|
} else {
|
||||||
const ${subclassName}List = this.${subclassName}List;
|
const ${subclassName}List = this.${subclassName}List
|
||||||
const checked${subClassName} = this.checked${subClassName};
|
const checked${subClassName} = this.checked${subClassName}
|
||||||
this.${subclassName}List = ${subclassName}List.filter(function(item) {
|
this.${subclassName}List = ${subclassName}List.filter(function(item) {
|
||||||
return checked${subClassName}.indexOf(item.index) == -1
|
return checked${subClassName}.indexOf(item.index) == -1
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 复选框选中数据 */
|
/** 复选框选中数据 */
|
||||||
@@ -598,5 +598,5 @@ export default {
|
|||||||
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
plain
|
plain
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
v-hasPermi="['${permissionPrefix}:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -136,9 +136,9 @@
|
|||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
|
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -271,26 +271,26 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="${BusinessName}">
|
<script setup name="${BusinessName}">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance()
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts});
|
const { ${dictsNoSymbol} } = proxy.useDict(${dicts})
|
||||||
#end
|
#end
|
||||||
|
|
||||||
const ${businessName}List = ref([]);
|
const ${businessName}List = ref([])
|
||||||
const ${businessName}Options = ref([]);
|
const ${businessName}Options = ref([])
|
||||||
const open = ref(false);
|
const open = ref(false)
|
||||||
const loading = ref(true);
|
const loading = ref(true)
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true)
|
||||||
const title = ref("");
|
const title = ref("")
|
||||||
const isExpandAll = ref(true);
|
const isExpandAll = ref(true)
|
||||||
const refreshTable = ref(true);
|
const refreshTable = ref(true)
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
const daterange${AttrName} = ref([]);
|
const daterange${AttrName} = ref([])
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@@ -318,16 +318,16 @@ const data = reactive({
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data)
|
||||||
|
|
||||||
/** 查询${functionName}列表 */
|
/** 查询${functionName}列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
queryParams.value.params = {};
|
queryParams.value.params = {}
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
@@ -335,31 +335,31 @@ function getList() {
|
|||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
|
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
|
||||||
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0];
|
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0]
|
||||||
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1];
|
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1]
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
list${BusinessName}(queryParams.value).then(response => {
|
list${BusinessName}(queryParams.value).then(response => {
|
||||||
${businessName}List.value = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}");
|
${businessName}List.value = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}")
|
||||||
loading.value = false;
|
loading.value = false
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询${functionName}下拉树结构 */
|
/** 查询${functionName}下拉树结构 */
|
||||||
function getTreeselect() {
|
function getTreeselect() {
|
||||||
list${BusinessName}().then(response => {
|
list${BusinessName}().then(response => {
|
||||||
${businessName}Options.value = [];
|
${businessName}Options.value = []
|
||||||
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] };
|
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] }
|
||||||
data.children = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}");
|
data.children = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}")
|
||||||
${businessName}Options.value.push(data);
|
${businessName}Options.value.push(data)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false
|
||||||
reset();
|
reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
@@ -372,13 +372,13 @@ function reset() {
|
|||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
};
|
}
|
||||||
proxy.resetForm("${businessName}Ref");
|
proxy.resetForm("${businessName}Ref")
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
getList();
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
@@ -386,52 +386,52 @@ function resetQuery() {
|
|||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
daterange${AttrName}.value = [];
|
daterange${AttrName}.value = []
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef")
|
||||||
handleQuery();
|
handleQuery()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd(row) {
|
function handleAdd(row) {
|
||||||
reset();
|
reset()
|
||||||
getTreeselect();
|
getTreeselect()
|
||||||
if (row != null && row.${treeCode}) {
|
if (row != null && row.${treeCode}) {
|
||||||
form.value.${treeParentCode} = row.${treeCode};
|
form.value.${treeParentCode} = row.${treeCode}
|
||||||
} else {
|
} else {
|
||||||
form.value.${treeParentCode} = 0;
|
form.value.${treeParentCode} = 0
|
||||||
}
|
}
|
||||||
open.value = true;
|
open.value = true
|
||||||
title.value = "添加${functionName}";
|
title.value = "添加${functionName}"
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
function toggleExpandAll() {
|
function toggleExpandAll() {
|
||||||
refreshTable.value = false;
|
refreshTable.value = false
|
||||||
isExpandAll.value = !isExpandAll.value;
|
isExpandAll.value = !isExpandAll.value
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
refreshTable.value = true;
|
refreshTable.value = true
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
async function handleUpdate(row) {
|
async function handleUpdate(row) {
|
||||||
reset();
|
reset()
|
||||||
await getTreeselect();
|
await getTreeselect()
|
||||||
if (row != null) {
|
if (row != null) {
|
||||||
form.value.${treeParentCode} = row.${treeCode};
|
form.value.${treeParentCode} = row.${treeParentCode}
|
||||||
}
|
}
|
||||||
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
||||||
form.value = response.data;
|
form.value = response.data
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.split(",");
|
form.value.$column.javaField = form.value.${column.javaField}.split(",")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
open.value = true;
|
open.value = true
|
||||||
title.value = "修改${functionName}";
|
title.value = "修改${functionName}"
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@@ -440,35 +440,35 @@ function submitForm() {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.join(",");
|
form.value.$column.javaField = form.value.${column.javaField}.join(",")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
if (form.value.${pkColumn.javaField} != null) {
|
if (form.value.${pkColumn.javaField} != null) {
|
||||||
update${BusinessName}(form.value).then(response => {
|
update${BusinessName}(form.value).then(response => {
|
||||||
proxy.#[[$modal]]#.msgSuccess("修改成功");
|
proxy.#[[$modal]]#.msgSuccess("修改成功")
|
||||||
open.value = false;
|
open.value = false
|
||||||
getList();
|
getList()
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
add${BusinessName}(form.value).then(response => {
|
add${BusinessName}(form.value).then(response => {
|
||||||
proxy.#[[$modal]]#.msgSuccess("新增成功");
|
proxy.#[[$modal]]#.msgSuccess("新增成功")
|
||||||
open.value = false;
|
open.value = false
|
||||||
getList();
|
getList()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
||||||
return del${BusinessName}(row.${pkColumn.javaField});
|
return del${BusinessName}(row.${pkColumn.javaField})
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
getList();
|
getList()
|
||||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
proxy.#[[$modal]]#.msgSuccess("删除成功")
|
||||||
}).catch(() => {});
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
getList();
|
getList()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
plain
|
plain
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
v-hasPermi="['${permissionPrefix}:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
icon="Edit"
|
icon="Edit"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
v-hasPermi="['${permissionPrefix}:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
icon="Delete"
|
icon="Delete"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
v-hasPermi="['${permissionPrefix}:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
plain
|
plain
|
||||||
icon="Download"
|
icon="Download"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
v-hasPermi="['${permissionPrefix}:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
@@ -148,8 +148,8 @@
|
|||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -343,33 +343,33 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="${BusinessName}">
|
<script setup name="${BusinessName}">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance()
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts});
|
const { ${dictsNoSymbol} } = proxy.useDict(${dicts})
|
||||||
#end
|
#end
|
||||||
|
|
||||||
const ${businessName}List = ref([]);
|
const ${businessName}List = ref([])
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
const ${subclassName}List = ref([]);
|
const ${subclassName}List = ref([])
|
||||||
#end
|
#end
|
||||||
const open = ref(false);
|
const open = ref(false)
|
||||||
const loading = ref(true);
|
const loading = ref(true)
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true)
|
||||||
const ids = ref([]);
|
const ids = ref([])
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
const checked${subClassName} = ref([]);
|
const checked${subClassName} = ref([])
|
||||||
#end
|
#end
|
||||||
const single = ref(true);
|
const single = ref(true)
|
||||||
const multiple = ref(true);
|
const multiple = ref(true)
|
||||||
const total = ref(0);
|
const total = ref(0)
|
||||||
const title = ref("");
|
const title = ref("")
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
const daterange${AttrName} = ref([]);
|
const daterange${AttrName} = ref([])
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@@ -399,16 +399,16 @@ const data = reactive({
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data)
|
||||||
|
|
||||||
/** 查询${functionName}列表 */
|
/** 查询${functionName}列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
queryParams.value.params = {};
|
queryParams.value.params = {}
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
@@ -416,22 +416,22 @@ function getList() {
|
|||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
|
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
|
||||||
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0];
|
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0]
|
||||||
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1];
|
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1]
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
list${BusinessName}(queryParams.value).then(response => {
|
list${BusinessName}(queryParams.value).then(response => {
|
||||||
${businessName}List.value = response.rows;
|
${businessName}List.value = response.rows
|
||||||
total.value = response.total;
|
total.value = response.total
|
||||||
loading.value = false;
|
loading.value = false
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false
|
||||||
reset();
|
reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
@@ -444,17 +444,17 @@ function reset() {
|
|||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
};
|
}
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
${subclassName}List.value = [];
|
${subclassName}List.value = []
|
||||||
#end
|
#end
|
||||||
proxy.resetForm("${businessName}Ref");
|
proxy.resetForm("${businessName}Ref")
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1
|
||||||
getList();
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
@@ -462,44 +462,44 @@ function resetQuery() {
|
|||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
daterange${AttrName}.value = [];
|
daterange${AttrName}.value = []
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef")
|
||||||
handleQuery();
|
handleQuery()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.${pkColumn.javaField});
|
ids.value = selection.map(item => item.${pkColumn.javaField})
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset()
|
||||||
open.value = true;
|
open.value = true
|
||||||
title.value = "添加${functionName}";
|
title.value = "添加${functionName}"
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset()
|
||||||
const _${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value
|
const _${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value
|
||||||
get${BusinessName}(_${pkColumn.javaField}).then(response => {
|
get${BusinessName}(_${pkColumn.javaField}).then(response => {
|
||||||
form.value = response.data;
|
form.value = response.data
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.split(",");
|
form.value.$column.javaField = form.value.${column.javaField}.split(",")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
${subclassName}List.value = response.data.${subclassName}List;
|
${subclassName}List.value = response.data.${subclassName}List
|
||||||
#end
|
#end
|
||||||
open.value = true;
|
open.value = true
|
||||||
title.value = "修改${functionName}";
|
title.value = "修改${functionName}"
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@@ -508,68 +508,68 @@ function submitForm() {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.join(",");
|
form.value.$column.javaField = form.value.${column.javaField}.join(",")
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
form.value.${subclassName}List = ${subclassName}List.value;
|
form.value.${subclassName}List = ${subclassName}List.value
|
||||||
#end
|
#end
|
||||||
if (form.value.${pkColumn.javaField} != null) {
|
if (form.value.${pkColumn.javaField} != null) {
|
||||||
update${BusinessName}(form.value).then(response => {
|
update${BusinessName}(form.value).then(response => {
|
||||||
proxy.#[[$modal]]#.msgSuccess("修改成功");
|
proxy.#[[$modal]]#.msgSuccess("修改成功")
|
||||||
open.value = false;
|
open.value = false
|
||||||
getList();
|
getList()
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
add${BusinessName}(form.value).then(response => {
|
add${BusinessName}(form.value).then(response => {
|
||||||
proxy.#[[$modal]]#.msgSuccess("新增成功");
|
proxy.#[[$modal]]#.msgSuccess("新增成功")
|
||||||
open.value = false;
|
open.value = false
|
||||||
getList();
|
getList()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
|
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value
|
||||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
|
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
|
||||||
return del${BusinessName}(_${pkColumn.javaField}s);
|
return del${BusinessName}(_${pkColumn.javaField}s)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
getList();
|
getList()
|
||||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
proxy.#[[$modal]]#.msgSuccess("删除成功")
|
||||||
}).catch(() => {});
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
#if($table.sub)
|
#if($table.sub)
|
||||||
/** ${subTable.functionName}序号 */
|
/** ${subTable.functionName}序号 */
|
||||||
function row${subClassName}Index({ row, rowIndex }) {
|
function row${subClassName}Index({ row, rowIndex }) {
|
||||||
row.index = rowIndex + 1;
|
row.index = rowIndex + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ${subTable.functionName}添加按钮操作 */
|
/** ${subTable.functionName}添加按钮操作 */
|
||||||
function handleAdd${subClassName}() {
|
function handleAdd${subClassName}() {
|
||||||
let obj = {};
|
let obj = {}
|
||||||
#foreach($column in $subTable.columns)
|
#foreach($column in $subTable.columns)
|
||||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
||||||
#elseif($column.list && "" != $javaField)
|
#elseif($column.list && "" != $javaField)
|
||||||
obj.$column.javaField = "";
|
obj.$column.javaField = ""
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
${subclassName}List.value.push(obj);
|
${subclassName}List.value.push(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ${subTable.functionName}删除按钮操作 */
|
/** ${subTable.functionName}删除按钮操作 */
|
||||||
function handleDelete${subClassName}() {
|
function handleDelete${subClassName}() {
|
||||||
if (checked${subClassName}.value.length == 0) {
|
if (checked${subClassName}.value.length == 0) {
|
||||||
proxy.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
|
proxy.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据")
|
||||||
} else {
|
} else {
|
||||||
const ${subclassName}s = ${subclassName}List.value;
|
const ${subclassName}s = ${subclassName}List.value
|
||||||
const checked${subClassName}s = checked${subClassName}.value;
|
const checked${subClassName}s = checked${subClassName}.value
|
||||||
${subclassName}List.value = ${subclassName}s.filter(function(item) {
|
${subclassName}List.value = ${subclassName}s.filter(function(item) {
|
||||||
return checked${subClassName}s.indexOf(item.index) == -1
|
return checked${subClassName}s.indexOf(item.index) == -1
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,5 +586,5 @@ function handleExport() {
|
|||||||
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
getList();
|
getList()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-modules</artifactId>
|
<artifactId>ruoyi-modules</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public class SysJobController extends BaseController
|
|||||||
@RequiresPermissions("monitor:job:remove")
|
@RequiresPermissions("monitor:job:remove")
|
||||||
@Log(title = "定时任务", businessType = BusinessType.DELETE)
|
@Log(title = "定时任务", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{jobIds}")
|
@DeleteMapping("/{jobIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException
|
public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException
|
||||||
{
|
{
|
||||||
jobService.deleteJobByIds(jobIds);
|
jobService.deleteJobByIds(jobIds);
|
||||||
return success();
|
return success();
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.ruoyi.job.util;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import org.quartz.Job;
|
import org.quartz.Job;
|
||||||
import org.quartz.JobExecutionContext;
|
import org.quartz.JobExecutionContext;
|
||||||
import org.quartz.JobExecutionException;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import com.ruoyi.common.core.constant.ScheduleConstants;
|
import com.ruoyi.common.core.constant.ScheduleConstants;
|
||||||
@@ -30,7 +29,7 @@ public abstract class AbstractQuartzJob implements Job
|
|||||||
private static ThreadLocal<Date> threadLocal = new ThreadLocal<>();
|
private static ThreadLocal<Date> threadLocal = new ThreadLocal<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(JobExecutionContext context) throws JobExecutionException
|
public void execute(JobExecutionContext context)
|
||||||
{
|
{
|
||||||
SysJob sysJob = new SysJob();
|
SysJob sysJob = new SysJob();
|
||||||
BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES));
|
BeanUtils.copyBeanProp(sysJob, context.getMergedJobDataMap().get(ScheduleConstants.TASK_PROPERTIES));
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public class JobInvokeUtil
|
|||||||
*/
|
*/
|
||||||
public static List<Object[]> getMethodParams(String invokeTarget)
|
public static List<Object[]> getMethodParams(String invokeTarget)
|
||||||
{
|
{
|
||||||
String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")");
|
String methodStr = StringUtils.substringBetweenLast(invokeTarget, "(", ")");
|
||||||
if (StringUtils.isEmpty(methodStr))
|
if (StringUtils.isEmpty(methodStr))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 9203
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: ${SERVER_NAME}
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: ${NACOS_SERVER}:${NACOS_PORT}
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- ${NACOS_SHARED_CONFIGS}
|
|
||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
name: ruoyi-job
|
name: ruoyi-job
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: ${SPRING_PROFILES_ACTIVE:dev}
|
active: dev
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-modules</artifactId>
|
<artifactId>ruoyi-modules</artifactId>
|
||||||
<version>3.6.5</version>
|
<version>3.6.6</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.utils.file.FileTypeUtils;
|
import com.ruoyi.common.core.utils.file.FileTypeUtils;
|
||||||
import com.ruoyi.common.core.utils.file.MimeTypeUtils;
|
import com.ruoyi.common.core.utils.file.MimeTypeUtils;
|
||||||
@@ -112,7 +113,8 @@ public class SysProfileController extends BaseController
|
|||||||
newPassword = SecurityUtils.encryptPassword(newPassword);
|
newPassword = SecurityUtils.encryptPassword(newPassword);
|
||||||
if (userService.resetUserPwd(userName, newPassword) > 0)
|
if (userService.resetUserPwd(userName, newPassword) > 0)
|
||||||
{
|
{
|
||||||
// 更新缓存用户密码
|
// 更新缓存用户密码&密码最后更新时间
|
||||||
|
loginUser.getSysUser().setPwdUpdateDate(DateUtils.getNowDate());
|
||||||
loginUser.getSysUser().setPassword(newPassword);
|
loginUser.getSysUser().setPassword(newPassword);
|
||||||
tokenService.setLoginUser(loginUser);
|
tokenService.setLoginUser(loginUser);
|
||||||
return success();
|
return success();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.controller;
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.common.core.web.controller.BaseController;
|
import com.ruoyi.common.core.web.controller.BaseController;
|
||||||
@@ -186,9 +189,35 @@ public class SysUserController extends BaseController
|
|||||||
ajax.put("user", user);
|
ajax.put("user", user);
|
||||||
ajax.put("roles", roles);
|
ajax.put("roles", roles);
|
||||||
ajax.put("permissions", permissions);
|
ajax.put("permissions", permissions);
|
||||||
|
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||||
|
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查初始密码是否提醒修改
|
||||||
|
public boolean initPasswordIsModify(Date pwdUpdateDate)
|
||||||
|
{
|
||||||
|
Integer initPasswordModify = Convert.toInt(configService.selectConfigByKey("sys.account.initPasswordModify"));
|
||||||
|
return initPasswordModify != null && initPasswordModify == 1 && pwdUpdateDate == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查密码是否过期
|
||||||
|
public boolean passwordIsExpiration(Date pwdUpdateDate)
|
||||||
|
{
|
||||||
|
Integer passwordValidateDays = Convert.toInt(configService.selectConfigByKey("sys.account.passwordValidateDays"));
|
||||||
|
if (passwordValidateDays != null && passwordValidateDays > 0)
|
||||||
|
{
|
||||||
|
if (StringUtils.isNull(pwdUpdateDate))
|
||||||
|
{
|
||||||
|
// 如果从未修改过初始密码,直接提醒过期
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Date nowDate = DateUtils.getNowDate();
|
||||||
|
return DateUtils.differentDaysByMillisecond(nowDate, pwdUpdateDate) > passwordValidateDays;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户编号获取详细信息
|
* 根据用户编号获取详细信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
|||||||
/**
|
/**
|
||||||
* 获取路由名称,如没有配置路由名称则取路由地址
|
* 获取路由名称,如没有配置路由名称则取路由地址
|
||||||
*
|
*
|
||||||
* @param routerName 路由名称
|
* @param name 路由名称
|
||||||
* @param path 路由地址
|
* @param path 路由地址
|
||||||
* @return 路由名称(驼峰格式)
|
* @return 路由名称(驼峰格式)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService
|
|||||||
// 多角色设置permissions属性,以便数据权限匹配权限
|
// 多角色设置permissions属性,以便数据权限匹配权限
|
||||||
for (SysRole role : roles)
|
for (SysRole role : roles)
|
||||||
{
|
{
|
||||||
if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL))
|
if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && !role.isAdmin())
|
||||||
{
|
{
|
||||||
Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
|
Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
|
||||||
role.setPermissions(rolePerms);
|
role.setPermissions(rolePerms);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user