gongchunyi
5 天以前 9f5813763a54f7fde8b472b0da305d635a624e8f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.ruoyi.framework.config;
 
import com.ruoyi.common.constant.CacheConstants;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
 
import javax.annotation.PostConstruct;
 
@Configuration
public class RedisKeyConfig {
 
    @Value("${ruoyi.redis.keyPrefix:}")
    private String keyPrefix;
 
    @PostConstruct
    public void init() {
        CacheConstants.setPrefix(keyPrefix == null ? "" : keyPrefix.trim());
    }
}