diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..42f9860 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,112 @@ +server: + # 端口 + port: 8027 + +############## Sa-Token 配置 (文档: https://sa-token.cc) ############## +sa-token: + # token 名称(同时也是 cookie 名称) + token-name: satoken + # token 有效期(单位:秒) 默认30天,-1 代表永久有效 + timeout: 1296000 + # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结 + active-timeout: -1 + # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token) + is-share: false + jwt-secret-key: "playeduxyz" + token-prefix: "Bearer" + # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik) +# token-style: jwt + is-log: true + sso-server: + is-slo: true + # Ticket有效期 (单位: 秒),默认五分钟 + ticket-timeout: 3000 + # 应用列表:配置接入的应用信息 + clients: + # 应用 sso-client2:采用模式三对接 + sso-client2: + client: playedu-client + allow-url: "*" + secret-key: SSO-C2-kQwIOrYvnXmSDkwEiFngrKidMcdrgKor + + + # MyBatis-Plus配置 +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + id-type: auto + logic-delete-field: deleted + logic-delete-value: 1 + logic-not-delete-value: 0 + +spring: + datasource: + # 移除type配置,使用默认的HikariCP + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://${DB_HOST}:3306/video?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai + username: ${DB_USER} + password: ${DB_PASSWORD} + hikari: + maximum-pool-size: 20 + minimum-idle: 5 + idle-timeout: 300000 + connection-timeout: 20000 + max-lifetime: 1200000 + main: + allow-circular-references: true # 临时允许循环依赖 + cache: + type: redis # 缓存配置,这里集成了redis和ehcache两种缓存方式,基本是使用redis。 + ehcache: + config: classpath:config/ehcache.xml + application: + name: bpms-sso # 服务名称 + profiles: + active: dev #启动环境 dev:开发环境 local:本地环境(需要将EnableTurbine注释掉) + cloud: + nacos: + discovery: + server-addr: http://${DB_HOST}:8848 + namespace: ng + username: nacos + password: ngsk0809 + config: + server-addr: http://${DB_HOST}:8848 + namespace: ng + file-extension: yml + username: nacos + password: ngsk0809 + import-check: + enabled: false + data: + redis: + open: true + host: ${DB_HOST} # 需替换 + port: 6379 # 需替换 + database: 0 # 需替换 + timeout: 6000 + password: ${REDIS_PASSWORD} # 需替换 + lettuce: + cluster: + refresh: + adaptive: true + period: 20 + shutdown-timeout: 6000ms + pool: + max-active: 20 + max-idle: 10 + max-wait: -1ms + min-idle: 5 + template: + defaultSerializer: + org.springframework.data.redis.serializer.StringRedisSerializer + + +jwt: + secret: bladexisapowerfulmicroservicearchitectureupgradedandoptimizedfromacommercialproject + expiration: 3600000 # 1小时,单位毫秒 + tokenHead: "Bearer " \ No newline at end of file