mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-02 23:23:28 +08:00
暂时去掉redis相关代码和依赖
This commit is contained in:
@@ -24,6 +24,19 @@
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-releases</id>
|
||||
<url>https://repo.spring.io/libs-release</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-releases</id>
|
||||
<url>https://repo.spring.io/libs-release</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
@@ -82,17 +95,17 @@
|
||||
</dependency>
|
||||
|
||||
<!--引入SpringBoot对Redis的依赖-->
|
||||
<dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
</dependency> -->
|
||||
|
||||
<!--SpringBoot将Session存储在Redis中-->
|
||||
<dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
<version>2.0.5.RELEASE</version>
|
||||
</dependency>
|
||||
</dependency> -->
|
||||
|
||||
<!-- lombok -->
|
||||
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
|
||||
@@ -278,11 +291,11 @@
|
||||
添加SpringBoot打包plugin
|
||||
解决【flashsale-1.0-SNAPSHOT.jar中没有主清单属性】问题
|
||||
-->
|
||||
<plugin>
|
||||
<!-- <plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
</plugin>
|
||||
</plugin> -->
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package plus.bookshelf.Controller.Controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
// import org.springframework.data.redis.core.RedisTemplate;
|
||||
import plus.bookshelf.Service.Model.UserModel;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -15,8 +15,8 @@ public class BaseController {
|
||||
@Autowired
|
||||
HttpServletRequest httpServletRequest;
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate redisTemplate;
|
||||
// @Autowired
|
||||
// private RedisTemplate redisTemplate;
|
||||
|
||||
/**
|
||||
* 获取用户登陆状态
|
||||
@@ -31,10 +31,10 @@ public class BaseController {
|
||||
*/
|
||||
public String onLogin(UserModel userModel) {
|
||||
String uuidToken = UUID.randomUUID().toString();
|
||||
redisTemplate.expire(uuidToken, 1, TimeUnit.HOURS);
|
||||
// redisTemplate.expire(uuidToken, 1, TimeUnit.HOURS);
|
||||
|
||||
// 建立token和用户登录态之间的联系
|
||||
redisTemplate.opsForValue().set(uuidToken, userModel);
|
||||
// // 建立token和用户登录态之间的联系
|
||||
// redisTemplate.opsForValue().set(uuidToken, userModel);
|
||||
return uuidToken;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user