fix(config): 修正数据库表名与Redis集成配置
- 更新UserDao查询表名从`user`改为`system_user`,字段`phone_number`改为`mobile` - 添加Spring Data Redis与Sa-Token Redis依赖,关闭多地同时登录 - 调整token名称、超时时间及本地/生产环境Redis和数据库配置 - 清理编译目录冗余配置文件并更新.gitignore忽略AGENTS.md
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -26,5 +26,4 @@ replay_pid*
|
|||||||
|
|
||||||
/.idea/
|
/.idea/
|
||||||
/target/
|
/target/
|
||||||
|
/AGENTS.md
|
||||||
|
|
||||||
|
|||||||
12
pom.xml
12
pom.xml
@@ -25,6 +25,18 @@
|
|||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- redis -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.dev33</groupId>
|
||||||
|
<artifactId>sa-token-redis-template</artifactId>
|
||||||
|
<version>1.44.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import java.util.List;
|
|||||||
public interface UserDao extends BaseMapper<UserModel> {
|
public interface UserDao extends BaseMapper<UserModel> {
|
||||||
|
|
||||||
// 根据用户的手机号查询用户
|
// 根据用户的手机号查询用户
|
||||||
@Select("SELECT * FROM `user` WHERE phone_number = #{phoneNumber}")
|
@Select("SELECT * FROM system_user WHERE mobile = #{phoneNumber}")
|
||||||
UserModel queryWithPhoneNumber(@Param("phoneNumber") String phoneNumber);
|
UserModel queryWithPhoneNumber(@Param("phoneNumber") String phoneNumber);
|
||||||
|
|
||||||
// 我邀请的pk数据
|
// 我邀请的pk数据
|
||||||
|
|||||||
@@ -5,9 +5,28 @@ spring:
|
|||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
username: root
|
username: root
|
||||||
password: 123asd
|
password: 123asd
|
||||||
url: jdbc:mysql://localhost:3306/vv_assistant?allowMultiQueries=true
|
url: jdbc:mysql://localhost:3306/ruoyi-vue-pro?allowMultiQueries=true
|
||||||
|
|
||||||
|
|
||||||
|
redis:
|
||||||
|
database: 1
|
||||||
|
host: localhost
|
||||||
|
port: 6379
|
||||||
|
timeout: 5000
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
# 连接池最大连接数
|
||||||
|
max-active: 200
|
||||||
|
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
|
max-wait: -1ms
|
||||||
|
# 连接池中的最大空闲连接
|
||||||
|
max-idle: 10
|
||||||
|
# 连接池中的最小空闲连接
|
||||||
|
min-idle: 0
|
||||||
chat:
|
chat:
|
||||||
appId: 1600092688
|
appId: 1600092688
|
||||||
appKey: 9bb6df04907a8cff9292eee8d6b32158d008350198acba11607068d91cb65f66
|
appKey: 9bb6df04907a8cff9292eee8d6b32158d008350198acba11607068d91cb65f66
|
||||||
|
|
||||||
|
|
||||||
|
activateUrl: http://192.168.2.22:8086/activationSuccessful/
|
||||||
|
verificationMailUrl: http://192.168.2.22:8086/verifyAccount/
|
||||||
|
forgetPassWordUrl: http://192.168.2.22:8086/resetPassword/
|
||||||
@@ -8,6 +8,13 @@ spring:
|
|||||||
url: jdbc:mysql://49.235.115.212:3336/vv_assistant
|
url: jdbc:mysql://49.235.115.212:3336/vv_assistant
|
||||||
|
|
||||||
|
|
||||||
|
redis:
|
||||||
|
database: 1
|
||||||
|
host: localhost
|
||||||
|
port: 16379
|
||||||
|
timeout: 5000
|
||||||
|
password: ezyPM2UQkPO8O6i8s9
|
||||||
|
|
||||||
chat:
|
chat:
|
||||||
appId: 1600086767
|
appId: 1600086767
|
||||||
appKey: 4f240bf11de12b5d8fc596556953f4f732416456ba5bcdc30c689913def0fc35
|
appKey: 4f240bf11de12b5d8fc596556953f4f732416456ba5bcdc30c689913def0fc35
|
||||||
@@ -27,13 +27,11 @@ mybatis-plus:
|
|||||||
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
|
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
|
||||||
sa-token:
|
sa-token:
|
||||||
# token 名称(同时也是 cookie 名称)
|
# token 名称(同时也是 cookie 名称)
|
||||||
token-name: token
|
token-name: vvtoken
|
||||||
# token 有效期(单位:秒) 默认30天,-1 代表永久有效
|
# token 有效期(单位:秒) 默认30天,-1 代表永久有效
|
||||||
timeout: -1
|
timeout: 172800
|
||||||
# token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
|
|
||||||
active-timeout: 648000
|
|
||||||
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
|
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
|
||||||
is-concurrent: true
|
is-concurrent: false
|
||||||
# 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
|
# 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
|
||||||
is-share: false
|
is-share: false
|
||||||
# token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
|
# token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
|
||||||
@@ -41,6 +39,7 @@ sa-token:
|
|||||||
# 是否输出操作日志
|
# 是否输出操作日志
|
||||||
is-log: true
|
is-log: true
|
||||||
|
|
||||||
|
|
||||||
activateUrl: https://pk.webapp.yolozs.com/activationSuccessful/
|
activateUrl: https://pk.webapp.yolozs.com/activationSuccessful/
|
||||||
verificationMailUrl: https://pk.webapp.yolozs.com/verifyAccount/
|
verificationMailUrl: https://pk.webapp.yolozs.com/verifyAccount/
|
||||||
forgetPassWordUrl: https://pk.webapp.yolozs.com/resetPassword/
|
forgetPassWordUrl: https://pk.webapp.yolozs.com/resetPassword/
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"groups": [
|
|
||||||
{
|
|
||||||
"name": "chat",
|
|
||||||
"type": "vvpkassistant.Data.WxChatParam",
|
|
||||||
"sourceType": "vvpkassistant.Data.WxChatParam"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": [
|
|
||||||
{
|
|
||||||
"name": "chat.app-id",
|
|
||||||
"type": "java.lang.String",
|
|
||||||
"sourceType": "vvpkassistant.Data.WxChatParam"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "chat.app-key",
|
|
||||||
"type": "java.lang.String",
|
|
||||||
"sourceType": "vvpkassistant.Data.WxChatParam"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"hints": []
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
spring:
|
|
||||||
datasource:
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
username: root
|
|
||||||
password: wfn53400
|
|
||||||
url: jdbc:mysql://mysql.text.zhukeping.com:3326/vv_assistant?allowMultiQueries=true
|
|
||||||
|
|
||||||
|
|
||||||
chat:
|
|
||||||
appId: 1600092688
|
|
||||||
appKey: 9bb6df04907a8cff9292eee8d6b32158d008350198acba11607068d91cb65f66
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
spring:
|
|
||||||
datasource:
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
username: root
|
|
||||||
password: 123asd
|
|
||||||
url: jdbc:mysql://localhost:3306/vv_assistant?allowMultiQueries=true
|
|
||||||
|
|
||||||
|
|
||||||
chat:
|
|
||||||
appId: 1600092688
|
|
||||||
appKey: 9bb6df04907a8cff9292eee8d6b32158d008350198acba11607068d91cb65f66
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
spring:
|
|
||||||
datasource:
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
username: root
|
|
||||||
password: niu995228
|
|
||||||
url: jdbc:mysql://49.235.115.212:3336/vv_assistant
|
|
||||||
|
|
||||||
|
|
||||||
chat:
|
|
||||||
appId: 1600086767
|
|
||||||
appKey: 4f240bf11de12b5d8fc596556953f4f732416456ba5bcdc30c689913def0fc35
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
server:
|
|
||||||
port: 8086
|
|
||||||
|
|
||||||
spring:
|
|
||||||
profiles:
|
|
||||||
active: local
|
|
||||||
# Spring 执行器配置,对应 TaskExecutionProperties 配置类。对于 Spring 异步任务,会使用该执行器。
|
|
||||||
execution:
|
|
||||||
thread-name-prefix: mail-task # 线程池的线程名的前缀。默认为 task- ,建议根据自己应用来设置
|
|
||||||
pool: # 线程池相关
|
|
||||||
core-size: 10 # 核心线程数,线程池创建时候初始化的线程数。默认为 8 。
|
|
||||||
max-size: 20 # 最大线程数,线程池最大的线程数,只有在缓冲队列满了之后,才会申请超过核心线程数的线程。默认为 Integer.MAX_VALUE
|
|
||||||
keep-alive: 60s # 允许线程的空闲时间,当超过了核心线程之外的线程,在空闲时间到达之后会被销毁。默认为 60 秒
|
|
||||||
queue-capacity: 200 # 缓冲队列大小,用来缓冲执行任务的队列的大小。默认为 Integer.MAX_VALUE 。
|
|
||||||
allow-core-thread-timeout: true # 是否允许核心线程超时,即开启线程池的动态增长和缩小。默认为 true 。
|
|
||||||
shutdown:
|
|
||||||
await-termination: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true
|
|
||||||
await-termination-period: 60 # 等待任务完成的最大时长,单位为秒。默认为 0 ,根据自己应用来设置
|
|
||||||
|
|
||||||
|
|
||||||
mybatis-plus:
|
|
||||||
global-config:
|
|
||||||
db-config:
|
|
||||||
id-type: auto
|
|
||||||
|
|
||||||
|
|
||||||
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
|
|
||||||
sa-token:
|
|
||||||
# token 名称(同时也是 cookie 名称)
|
|
||||||
token-name: token
|
|
||||||
# token 有效期(单位:秒) 默认30天,-1 代表永久有效
|
|
||||||
timeout: -1
|
|
||||||
# token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
|
|
||||||
active-timeout: 648000
|
|
||||||
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
|
|
||||||
is-concurrent: true
|
|
||||||
# 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
|
|
||||||
is-share: false
|
|
||||||
# token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
|
|
||||||
token-style: random-128
|
|
||||||
# 是否输出操作日志
|
|
||||||
is-log: true
|
|
||||||
|
|
||||||
activateUrl: https://pk.webapp.yolozs.com/activationSuccessful/
|
|
||||||
verificationMailUrl: https://pk.webapp.yolozs.com/verifyAccount/
|
|
||||||
forgetPassWordUrl: https://pk.webapp.yolozs.com/resetPassword/
|
|
||||||
|
|
||||||
dromara:
|
|
||||||
x-file-storage: #文件存储配置
|
|
||||||
default-platform: tencent-cos-1 #默认使用的存储平台
|
|
||||||
thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】
|
|
||||||
tencent-cos:
|
|
||||||
- platform: tencent-cos-1 # 存储平台标识
|
|
||||||
enable-storage: true # 启用存储
|
|
||||||
secret-id: AKIDNbcQ1c3HJD9rQ6g5PaZN0PekcIkyzmMl
|
|
||||||
secret-key: Nl4FI9mLo46vWu40iT0JQK8j8LK5cw2u
|
|
||||||
region: ap-shanghai #存仓库所在地域
|
|
||||||
bucket-name: vv-1317974657
|
|
||||||
domain: https://vv-1317974657.cos.ap-shanghai.myqcloud.com # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/
|
|
||||||
base-path: /headerIcon/ # 基础路径
|
|
||||||
|
|
||||||
IM-secretKey: 04452c3231ae4fe5
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Configuration status="DEBUG">
|
|
||||||
<Appenders>
|
|
||||||
<!-- 控制台输出 -->
|
|
||||||
<Console name="Console" target="SYSTEM_OUT">
|
|
||||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/>
|
|
||||||
</Console>
|
|
||||||
<!-- 文件输出 -->
|
|
||||||
<File name="FileAppender" fileName="logs/app.log">
|
|
||||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/>
|
|
||||||
</File>
|
|
||||||
</Appenders>
|
|
||||||
<Loggers>
|
|
||||||
<Root level="DEBUG">
|
|
||||||
<AppenderRef ref="Console"/>
|
|
||||||
<AppenderRef ref="FileAppender"/>
|
|
||||||
</Root>
|
|
||||||
</Loggers>
|
|
||||||
</Configuration>
|
|
||||||
Reference in New Issue
Block a user