sa-token-dao-redisx:添加 readme

This commit is contained in:
noear 2022-05-10 13:47:49 +08:00
parent df6ea7ec4e
commit c1e7dce1dc
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,33 @@
### 使用示例
#### 1.配置
```yaml
sa-token-dao: #名字可以随意取
redis:
server: "localhost:6379"
password: 123456
db: 1
```
#### 2.代码
**注入风格**
```java
@Configuration
public class Config {
@Bean
public SaTokenDao saTokenDaoInit(@Inject("${sa-token-dao.redis}") SaTokenDaoOfRedis saTokenDao) {
return saTokenDao;
}
}
```
**手动风格**
```java
SaTokenDaoOfRedis saTokenDao = new SaTokenDaoOfRedis(props);
SaManager.setSaTokenDao(saTokenDao);
```

View File

@ -34,6 +34,7 @@
<groupId>org.noear</groupId>
<artifactId>solon-test</artifactId>
<version>1.7.5</version>
<scope>test</scope>
</dependency>
</dependencies>