application.yml 4.7 KB
# 多环境通用配置(每个环境都一样的写到这里)
lhcredit:
  # 名称
  name: lhcaizhi
  # 版本
  version: 3.4.0
  # 版权年份
  copyrightYear: 2019
  # 获取ip地址开关
  addressEnabled: true

# 开发环境配置
server:
  # 服务器的HTTP端口,默认为80
  servlet:
    # 应用的访问路径
    context-path: /
  tomcat:
    # tomcat的URI编码
    uri-encoding: UTF-8
    # tomcat最大线程数,默认为200
    max-threads: 800
    # Tomcat启动初始化的线程数,默认值25
    min-spare-threads: 30

# 用户配置
user:
  password:
    # 密码错误{maxRetryCount}次锁定10分钟
    maxRetryCount: 5

# Spring配置
spring:
  # 模板引擎
  thymeleaf:
    mode: HTML
    encoding: utf-8
    # 禁用缓存
    cache: false
  # 资源信息
  messages:
    # 国际化资源文件路径
    basename: static/i18n/messages
  jackson:
    time-zone: GMT+8
    date-format: yyyy-MM-dd HH:mm:ss
  #profiles默认读取dev
  profiles:
     active: prod
#    active: dev-ly

  # 文件上传
  servlet:
     multipart:
       # 单个文件大小
       max-file-size:  30MB

       # 设置总上传的文件大小
       max-request-size:  100MB
  # 服务模块
  devtools:
    restart:
      # 热部署开关
      enabled: true
  # 邮箱
  mail:
    host: smtp.exmail.qq.com
    username: lhdna-service@lhcis.com
    password: lhdNa2016
    default-encoding: UTF-8
  # 数据库通用配置
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    druid:
      # 初始连接数
      initialSize: 10
      # 最小连接池数量
      minIdle: 15
      # 最大连接池数量
      maxActive: 50
      # 配置获取连接等待超时的时间
      maxWait: 60000
      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
      timeBetweenEvictionRunsMillis: 60000
      # 配置一个连接在池中最小生存的时间,单位是毫秒
      minEvictableIdleTimeMillis: 300000
      # 配置一个连接在池中最大生存的时间,单位是毫秒
      maxEvictableIdleTimeMillis: 900000
      # 配置检测连接是否有效
      validationQuery: SELECT 1 FROM DUAL
      testWhileIdle: true
      testOnBorrow: false
      testOnReturn: false
      webStatFilter:
        enabled: true
      statViewServlet:
        enabled: true
        # 设置白名单,不填则允许所有访问
        allow:
        url-pattern: /monitor/druid/*
      filter:
        stat:
          enabled: true
          # 慢SQL记录
          log-slow-sql: true
          slow-sql-millis: 1000
          merge-sql: true
        wall:
          config:
            multi-statement-allow: true
  cache:
    type: ehcache
    ehcache:
      config: classpath:ehcache/ehcache.xml
# MyBatis
mybatis:
    # 搜索指定包别名
    typeAliasesPackage: com.lhcredit.project
    # 配置mapper的扫描,找到所有的mapper.xml映射文件
    mapperLocations: classpath:mybatis/**/*Mapper.xml
    # 加载全局的配置文件
    configLocation: classpath:mybatis/mybatis-config.xml

# PageHelper分页插件
pagehelper:
  helperDialect: mysql
  #分页合理化 关闭
  reasonable: false
  supportMethodsArguments: true
  params: count=countSql

# Shiro
shiro:
  user:
    # 登录地址
    loginUrl: /login
    # 权限认证失败地址
    unauthorizedUrl: /unauth
    # 首页地址
    indexUrl: /index
    # 验证码开关
    captchaEnabled: true
    # 验证码类型 math 数组计算 char 字符
    captchaType: math
  cookie:
    # 设置Cookie的域名 默认空,即当前访问的域名
    domain:
    # 设置cookie的有效访问路径
    path: /
    # 设置HttpOnly属性
    httpOnly: true
    # 设置Cookie的过期时间,天为单位
    maxAge: 30
  session:
    # 系统Session超时时间(默认30分钟)
    expireTime: 30
    # 对外接口Session超时时间(默认一天,1440分钟)
    webExpireTime: 1440
    # 同步session到数据库的周期(默认1分钟)
    dbSyncPeriod: 1
    # 相隔多久检查一次session的有效性,默认就是10分钟
    validationInterval: 10
    # 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
    kickoutAfter: false

# 防止XSS攻击
xss:
  # 过滤开关
  enabled: true
  # 排除链接(多个用逗号分隔)
  excludes: /system/notice/*
  # 匹配链接
  urlPatterns: /system/*,/monitor/*,/tool/*

# 代码生成
gen:
  # 作者
  author: lhcredit
  # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool business
  packageName: com.lhcredit.project.business
  # 自动去除表前缀,默认是true
  autoRemovePre: true
  # 表前缀(类名不会包含表前缀)
  tablePrefix: bs_