xuefei
2023-04-28 5d9101e8627bca8e1ec25739777bfc2bdc8c104e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# 配置文件加密key 生产环境中可通过环境变量、命令行等形式进行设置
jasypt:
  encryptor:
    password: xboot
 
server:
  port: 9091
  servlet:
    context-path: /
  tomcat:
    uri-encoding: UTF-8
    threads:
      max: 1000
      min-spare: 30
    # 最大吞吐量不限制
    max-swallow-size: -1
  # 优雅停机 关闭容器后默认等待30秒继续执行没处理完的任务 避免数据不一致
  shutdown: graceful
 
spring:
  lifecycle:
    # 配置优雅停机后的缓冲器 最大等待时间
    timeout-per-shutdown-phase: 10S
  # 数据源
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/tobacco?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
    username: root
    # Jasypt加密 可到common-utils中找到JasyptUtil加解密工具类生成加密结果 格式为ENC(加密结果) 以下解密结果为123456
    #password: wanghaojie
    password: rootroot
    type: com.alibaba.druid.pool.DruidDataSource
    driverClassName: com.mysql.jdbc.Driver
    # Druid StatViewServlet配置
    druid:
      stat-view-servlet:
        # 默认true 内置监控页面首页/druid/index.html
        enabled: true
        url-pattern: /druid/*
        # 允许清空统计数据
        reset-enable: true
        login-username: root
        login-password: boyingabcd12221!
        # IP白名单 多个逗号分隔
        allow:
        # IP黑名单
        deny:
      filter:
        stat:
          # 开启监控sql
          enabled: true
          # 显示并标注慢sql 默认当超过3秒显示
          log-slow-sql: true
          slow-sql-millis: 3000
          merge-sql: true
        # 防SQL注入过滤
        wall:
          config:
            # 允许多条sql同时执行
            multi-statement-allow: true
  jpa:
    # 显示sql
    show-sql: true
    # 自动生成表结构
    hibernate:
      ddl-auto: update
  # Redis
  redis:
    host: 127.0.0.1
    # 数据库索引 默认0
    database: 1
    port: 6379
    # 超时时间 Duration类型 3秒
    timeout: 3S
  # Elasticsearch
  data:
    elasticsearch:
      # 暂未使用ES 关闭其持久化存储
      repositories:
        enabled: false
  elasticsearch:
    rest:
      # 要连接的ES客户端Rest Uri 多个逗号分隔
      uris: http://localhost:9200
  # 定时任务
  quartz:
    # 任务信息存储至数据库
    job-store-type: jdbc
    jdbc:
      # 自动生成表 若已有表数据请务必关闭 ALWAYS/EMBEDDED/NEVER
      initialize-schema: NEVER
    properties:
      org:
        quartz:
          scheduler:
            # 允许调度程序节点一次获取(触发)的最大触发器数
            batchTriggerAcquisitionMaxCount: 5
          jobStore:
            # 加锁调度
            acquireTriggersWithinLock: true
            # “容忍”触发器经过下一次触发时间的毫秒数
            misfireThreshold: 10000
  # 工作流
  activiti:
    check-process-definitions: false
    db-identity-used: true
    # 自动生成Activiti相关表 第一次生成后建议关闭提高运行速度
    database-schema-update: true
    history-level: full
    # 扩展配置
    xboot:
      # 流程图字体 默认宋体
      activityFontName: Microsoft YaHei
      labelFontName: Microsoft YaHei
  # 文件大小上传配置
  servlet:
    multipart:
      max-file-size: -1
      max-request-size: -1
  jackson:
    time-zone: GMT+8
    serialization:
      fail-on-empty-beans: false
  boot:
    admin:
      # 修改上下文路径
      context-path: /xboot/admin
      client:
        # 服务端url
        url: http://127.0.0.1:${server.port}/xboot/admin
        instance:
          # 实例url
          service-base-url: http://127.0.0.1:${server.port}/
  web:
    resources:
      static-locations: classpath:/static
      cache:
        cachecontrol:
          # 静态资源缓存30天
          max-age: 30D
  autoconfigure:
    exclude:
      # Activiti5.22需要排除
      - org.activiti.spring.boot.SecurityAutoConfiguration
      # 暂未使用ES 排除client自动装配类
      - org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRestClientAutoConfiguration
 
  mvc:
    static-path-pattern: //**
xboot:
  # 全局限流
  ratelimit:
    # 开启
    enable: false
    # 每1秒内(单位毫秒)
    timeout: 1000
    # 总限制200个请求(单位个)
    limit: 2000
  # IP限流
  iplimit:
    # 开启
    enable: false
    # 每1秒内(单位毫秒)
    timeout: 1000
    # 每个ip限制20个请求(单位个)
    limit: 200
  # 后台token交互方式
  token:
    # 默认为true,token将存入redis,并具有单点登录功能 设为false使用JWT交互
    redis: true
    # 是否开启单设备登陆 仅当token交互方式为redis时生效
    sdl: false
    # token中存储用户权限数据 设为true开启后可避免每次请求再获取用户权限,但有可能导致编辑权限菜单后无法读取到最新权限数据(需用户重新登录)
    storePerms: true
    # token过期时间 redis模式有请求自动刷新(分钟)
    tokenExpireTime: 60000
    # 用户选择 保存登录状态/记住我 对应token过期时间(天)
    saveLoginTime: 7
    # 限制用户登陆错误次数(次)
    loginTimeLimit: 10
    # 错误超过次数后多少分钟后才能继续登录(分钟)
    loginAfterTime: 1
  # app应用 token交互配置
  appToken:
    # 是否开启同一平台单设备登陆(如安卓设备只允许登录一个相同账号,同时IOS设备可允许一个设备登陆)
    spl: true
    # token过期时间 有请求自动刷新(天)
    tokenExpireTime: 30
  # 使用Spring @Cacheable注解失效时间
  cache:
    # 缓存过期时间 Duration类型 D–天 H小时 M–分钟 S–秒 永久不过期设为非正值
    timeToLive: 15D
  # 日志记录方式 true使用Elasticsearch记录 false记录至数据库中
  logRecord:
    es: false
  # 文件大小上传配置 单位MB
  maxUploadFile: 5
  # 腾讯位置服务key配置 腾讯位置服务官网注册添加key
  qqlbs:
    key: 你的腾讯位置服务key
  # 第三方社交登录配置
  social:
    # 前端回调登录地址
    callbackFeUrl: http://127.0.0.1:9999/login
    # 前端绑定账号回调地址
    callbackFeRelateUrl: http://127.0.0.1:9999/relate
    # github
    github:
      clientId: 你的clientId
      clientSecret: 你的clientSecret
      callbackUrl: http://127.0.0.1:8888/xboot/social/github/callback
    # qq
    qq:
      appId: 你的appId
      appKey: 你的appKey
      callbackUrl: http://127.0.0.1:8888/xboot/social/qq/callback
    # weibo
    weibo:
      appKey: 你的appKey
      appSecret: 你的appSecret
      callbackUrl: http://127.0.0.1:8888/xboot/social/weibo/callback
    # wechat
    wechat:
      appId: 你的appId
      appSecret: 你的appSecret
      callbackUrl: http://127.0.0.1:8888/xboot/social/wechat/callback
    # 钉钉
    dingding:
      # 扫码登录应用
      appId: 你的appId
      appSecret: 你的appSecret
      callbackUrl: http://127.0.0.1:8888/xboot/social/dingding/callback
    # 企业微信
    workwechat:
      appId: 你的appId 企业的CorpID
      agentId: 你的应用ID
      appSecret: 你的应用Secret
      callbackUrl: http://127.0.0.1:8888/xboot/social/workwechat/callback
 
# 需要验证码校验的接口路径 支持通配符 自动过滤拦截校验 无需开发人员再次校验
captcha:
  # 图片验证码验证
  image:
    - /xboot/login # 登录接口
    - /xboot/oauth2/authorize # 认证接口
  # 短信验证码验证
  sms:
    - /xboot/user/regist # 注册接口
    - /xboot/user/smsLogin # 短信登录接口
    - /xboot/user/resetByMobile # 手机重置密码
    - /xboot/user/changeMobile # 更换绑定手机
    - /xboot/app/v1/member/quickLogin # 会员快捷登录注册接口
  # Vaptcha验证码验证
  vaptcha:
    - /xboot/common/captcha/sendRegistSms/** # 发送注册短信
    - /xboot/common/captcha/sendResetSms/** # 发送重置密码短信
    - /xboot/email/sendResetCode/** # 发送重置密码邮件
    - /xboot/social/relate # 绑定第三方账号
  # Email验证码验证
  email:
    - /xboot/email/resetByEmail # 邮件重置密码
    - /xboot/email/editEmail # 修改绑定邮箱
 
# 忽略url
ignored:
  # 无需登录认证的请求
  urls:
    - /xboot/app/v1/**
    - /xboot/oauth2/**
    - /xboot/actuator/**
    - /xboot/admin/**
    - /chat/**
    - /modeler/**
    - /editor-app/**
    - /xboot/act/**
    - /xboot/dictData/getByType/**
    - /xboot/email/sendResetCode/**
    - /xboot/email/resetByEmail
    - /xboot/file/view/**
    - /xboot/social/**
    - /xboot/ws/**
    - /xboot/setting/notice
    - /xboot/user/regist
    - /xboot/user/smsLogin
    - /xboot/user/resetByMobile
    - /xboot/common/**
    - /druid/**
    - /doc.html
    - /swagger-resources/**
    - /v2/api-docs
    - /**/*.js
    - /**/*.css
    - /**/*.png
    - /**/*.ico
    - /xboot/test/**
    - /xboot/fingerprint/getAll
    - /xboot/orderSyn/**
    - /hk/**
    - /xboot/wx/**
    - /index.html
#    - /xboot/pcStatistic/**
#    - /xboot/pcStatistic2/**
#    - /xboot/pcStatistic3/**
#    - /xboot/area/getAll
#    - /xboot/areaSection/getAll2
    - /xboot/message/**
    - /xboot/updateApp/**
    - /xboot/fingerprint/getUserByCode
  # 限流及黑名单不拦截的路径
  limitUrls:
    - /**/*.js
    - /**/*.css
    - /**/*.png
    - /**/*.ico
 
# Actuator
management:
  health:
    # 暂未用到ES 关闭其健康检查
    elasticsearch:
      enabled: false
  endpoint:
    health:
      show-details: always
      status:
        http-mapping:
          DOWN: 200
          OUT_OF_SERVICE: 200
          FATAL: 200
          UNKNOWN: 200
  endpoints:
    web:
      base-path: /xboot/actuator/
      exposure:
        include: '*'
 
# 接口文档增强UI Swagger界面内容配置
knife4j:
  enable: true
 
swagger:
  title: XBoot API接口文档
  description: XBoot Api Documentation
  version: 1.0.0
  termsOfServiceUrl: http://xxxx
  contact:
    name: xxx
    url: http://blog.xxx.cn
    email: xxxx@qq.com
  # 分组名
  group: 1.接口 v1.0
  group2: 2.APP接口 v1.0
 
# Mybatis-plus
mybatis-plus:
  mapper-locations: classpath*:mapper/*.xml
#  configuration:
    # 日志控制台打印
#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 
# 日志
logging:
  # 输出级别
  level:
    root: info
  file:
    # 指定路径
    path: xboot-logs
  logback:
    rollingpolicy:
      # 最大保存天数
      max-history: 7
      # 每个文件最大大小
      max-file-size: 5MB