11
This commit is contained in:
@@ -4,6 +4,7 @@ import com.ruoyi.cai.constant.RedisHttpConstant;
|
|||||||
import com.ruoyi.cai.enums.SystemConfigEnum;
|
import com.ruoyi.cai.enums.SystemConfigEnum;
|
||||||
import com.ruoyi.cai.enums.systemconfig.SystemCheckResp;
|
import com.ruoyi.cai.enums.systemconfig.SystemCheckResp;
|
||||||
import com.ruoyi.common.core.service.SensitiveService;
|
import com.ruoyi.common.core.service.SensitiveService;
|
||||||
|
import com.ruoyi.common.helper.LoginHelper;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -160,6 +161,10 @@ public class SystemConfigManager {
|
|||||||
|
|
||||||
public void set(String key, String value) {
|
public void set(String key, String value) {
|
||||||
if(key.equals(SystemConfigEnum.SENSITIVE_ENABLE.getKey())){
|
if(key.equals(SystemConfigEnum.SENSITIVE_ENABLE.getKey())){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
if(!LoginHelper.isAdmin(userId)){
|
||||||
|
throw new RuntimeException("非超管无法修该配置");
|
||||||
|
}
|
||||||
sensitiveService.setSensitive(value.equals("1"));
|
sensitiveService.setSensitive(value.equals("1"));
|
||||||
}
|
}
|
||||||
redisTemplate.opsForHash().put(RedisHttpConstant.SYSTEM_CONFIG, key,value);
|
redisTemplate.opsForHash().put(RedisHttpConstant.SYSTEM_CONFIG, key,value);
|
||||||
|
|||||||
Reference in New Issue
Block a user