mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-04-05 17:37:53 +08:00
sa-token-dao-redisx:添加 readme
This commit is contained in:
parent
df6ea7ec4e
commit
c1e7dce1dc
33
sa-token-plugin/sa-token-dao-redisx/README.md
Normal file
33
sa-token-plugin/sa-token-dao-redisx/README.md
Normal 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);
|
||||
```
|
@ -34,6 +34,7 @@
|
||||
<groupId>org.noear</groupId>
|
||||
<artifactId>solon-test</artifactId>
|
||||
<version>1.7.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user