| | |
| | | import javax.annotation.PostConstruct;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.common.constant.Constants;
|
| | | import com.ruoyi.common.constant.CacheConstants;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.common.exception.ServiceException;
|
| | |
| | | * @return true开启,false关闭
|
| | | */
|
| | | @Override
|
| | | public boolean selectCaptchaOnOff()
|
| | | public boolean selectCaptchaEnabled()
|
| | | {
|
| | | String captchaOnOff = selectConfigByKey("sys.account.captchaOnOff");
|
| | | if (StringUtils.isEmpty(captchaOnOff))
|
| | | String captchaEnabled = selectConfigByKey("sys.account.captchaEnabled");
|
| | | if (StringUtils.isEmpty(captchaEnabled))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return Convert.toBool(captchaOnOff);
|
| | | return Convert.toBool(captchaEnabled);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @Override
|
| | | public void clearConfigCache()
|
| | | {
|
| | | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
|
| | | Collection<String> keys = redisCache.keys(CacheConstants.SYS_CONFIG_KEY + "*");
|
| | | redisCache.deleteObject(keys);
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | private String getCacheKey(String configKey)
|
| | | {
|
| | | return Constants.SYS_CONFIG_KEY + configKey;
|
| | | return CacheConstants.SYS_CONFIG_KEY + configKey;
|
| | | }
|
| | | }
|