菜单

后端配置文件

下载

nVisual后端是基于springboot框架开发的java项目,程序配置存在application.properties内

内容说明

描述 属性 示例
用于加密令牌的字符串 jwt.secret h0UbhCV6eLiEPZkIvWjNGHLqOQP1F12aaP7D8rEAWCwoCWawQJ
用于加密刷新令牌的字符串 jwt.refresh.secret fpsz8SpQNNH6jx7Y2JHBmBWo5wCme7mjSRadMn3X1zoPnW6RMB
用于解密来自前端的某些数据的字符串 jasypt.encryptor.password 78893572ihfwey79f8hwe89fh7ft79gf78gf86fg86g846gfewyufghw7e9fgy
用于解密来自前端的某些数据的字符串 jasypt.frontend.backend.array kjfgwekjhfoiefoiehpfopewgkewljgpiewhfioewbnfpojwephfpoewngkewng
token到期时间(毫秒)10分钟600000。当需要变为一年时填31536000000 jwt.expirationInMs 600000
刷新token过期时间(毫秒)40分钟2400000 jwt.refreshExpirationDateInMs 2400000
程序内AES加密的秘钥 aes.frontend.backend W8P2yyjTH81E6PyOAp6ZzIMVbXaleuN2B2DfF4hJf3Gfx2w1lcuLCQbPT4GJ
后台服务端口号 server.port 8081
是否是saas环境包,是saas则true enable.saas true
是否启用单点登录,启用写true enable.sso false
对于SAAS短信验证码有效的期限 saas.six.digits.code.validity.ms 120000
SAAS环境连接的数据库地址 saas.database jdbc:postgresql://10.1.0.1:5432
SAAS短信SMS服务提供商的地址 saas.sms.one.time.password.url.service https://api.mix2.zthysms.com/v2/sendSms
SMS服务提供商用户名 sms.username rxxxxxx
SMS服务提供商密码 sms.password Nxxxxxxxx
特定用户的许可证 saas.license LICENSEKEYRjMwNUI4QkIwRDZGNjU1ODNEODNERDU4RjUzMTUwQUVFOTI5OUJENEZENEQ2
SAAS限制用户请求频率,避免一个用户短时间内多次请求 saas.user.exceeded.six.digits.code.request.ban.timer.ms 5000
启用MVC Thymeleaf视图分辨率 spring.thymeleaf.enabled true
在构建URL时预先查看名称的前缀 spring.thymeleaf.prefix classpath:/templates/
构建URL时附加查看名称的后缀 spring.thymeleaf.suffix .jsp
jpa连接数据库平台 spring.jpa.database-platform org.hibernate.spatial.dialect.postgis.PostgisPG9Dialect
jpa的hibernate方言 spring.jpa.properties.hibernate.dialect org.hibernate.spatial.dialect.postgis.PostgisDialect
hibernate方言配置 spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation true
hibernate方言配置 spring.jpa.properties.hibernate.proc.param_null_passing true
数据源驱动程序类名 spring.datasource.driver-class-name org.postgresql.Driver
数据库连接地址和端口号以及库名 spring.datasource.url jdbc:postgresql://1.1.0.1:5432/nvisual?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=UTC
数据库用户名 spring.datasource.username pxxxxxx
数据库密码 spring.datasource.password Nxxxxxxxxx
数据源类型 spring.datasource.type com.zaxxer.hikari.HikariDataSource
最小空闲连接 spring.datasource.hikari.minimumIdle 5
最大连接数 spring.datasource.hikari.maximumPoolSize 100
空闲连接超时时间 spring.datasource.hikari.idleTimeout 30000
池名称 spring.datasource.hikari.poolName SpringBootJPAHikariCP
连接最大存活时间 spring.datasource.hikari.maxLifetime 2000000
连接超时时间 spring.datasource.hikari.connectionTimeout 30000
优化启动速度 spring.main.lazy-initialization true
优化启动速度 spring.jmx.enabled true
sso 重定向地址 sso.server.and.redirect http://10.121.1.14:9000/sso/auth?redirect=http://10.121.1.23:8889/sso/login
CAD vjmap工作区 vjmap.url http://172.18.20.233:27660
vjmap工作区token vjmap.token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MSwiVXNlcm5hb
文件上传功能开启 spring.servlet.multipart.enabled true
文件写入磁盘的阈值,默认是0 spring.servlet.multipart.file-size-threshold 2KB
单个文件的最大值 spring.servlet.multipart.max-file-size 200MB
多个文件上传时的总大小 spring.servlet.multipart.max-request-size 200MB
允许用户登录失败的次数(正确的用户但密码错误) user.failed.login.allowance 5
在本地变量中注册失败登录的时间 login.failed.login.timer.ms 1800000
系统内前端文件请求路径 dist.path ..//nvisual-frontend//dist
显示info日志 logging.level.root info
内存缓存配置 spring.cache.typ ehcache
内存缓存配置文件名 spring.cache.ehcache.config classpath:ehcache.xml
缓存周期 rareconfig.excuteTimeCron "0/10 * * * * *"

重要配置

复制代码
jwt.expirationInMs=600000

token过期时间,600000是10分钟过期,如果想延长到一年过期则填入31536000000

复制代码
enable.saas=true

当你的项目是非SAAS环境时(即单项目部署时)这里记得改为false。给用户部署时,这里不改为false则登录失败或文件目录索引错误

复制代码
enable.sso=false

当你的项目需要开启sso时,这里需要改为true

复制代码
spring.datasource.url=jdbc:postgresql://100.100.0.100:5432/nvisual_cloud?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=UTC

需要根据项目情况将上述100.100.0.100改为数据库所属服务器ip;

PG默认端口是5432,如果默认没有更改则继续用5432;

部署的数据库名如果不是nvisual_cloud则应该替换更改

复制代码
spring.datasource.username=pxxxx
spring.datasource.password=Nxxxxx

需要根据项目情况将数据库用户名密码更改

复制代码
dist.path=..//nvisual-frontend//dist
#dist.path=nginx//html//dist

需要根据项目情况将前端文件路径配置正确

//是windows和linux内都认的斜杠符

一般widows部署填:dist.path=nginx//html//dist

linux部署填:..//nvisual-frontend//dist

配置文件的修改

windows

1.确保要修改配置文件的jar未运行(如果windows部署,在部署目录下,找到stop.bat,双击运行)

2.使用压缩软件,例如7z打开jar包(如果windows部署,在部署目录下\jre\bin内找到nvisual-lite-view-xxxxxxxx-8081.jar)

3.进入BOOT-INF/classes目录下找到application.properties文件

4.使用记事本打开,修改对应配置,保存关闭即可。(关闭后可以再从压缩包打开检查一遍保存是否生效)

Linux

1.找到jar包所在位置(cd /home/nvisual-backend/到jar包存放地址)

2.查看要修改的jar包是否运行,运行的话需要停止

ps -ef|grep java查看运行的java程序

kill -9 id停止运行的java程序

3.vim jar包的全称

4.打开列表后,可以用 /application.properties 打开配置文件

5.修改完后,:wq保存即可,会回到列表页,列表页直接使用:q退出

上一个
前端目录结构
下一个
前端配置文件
最近修改: 2024-05-28