configKey接口匿名访问

This commit is contained in:
dftre 2024-09-12 11:19:19 +08:00
parent 0536ca3a4b
commit be168e54b7
2 changed files with 3 additions and 5 deletions

View File

@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -80,6 +81,7 @@ public class SysConfigController extends BaseController
*/
@Operation(summary = "根据参数键名查询参数值")
@GetMapping(value = "/configKey/{configKey}")
@Anonymous
public AjaxResult getConfigKey(@PathVariable( name = "configKey" ) String configKey)
{
return success(configService.selectConfigByKey(configKey));

View File

@ -89,11 +89,7 @@ public class SysConfigServiceImpl implements ISysConfigService
public boolean selectCaptchaEnabled()
{
String captchaEnabled = selectConfigByKey("sys.account.captchaEnabled");
if (StringUtils.isEmpty(captchaEnabled))
{
return true;
}
return Convert.toBool(captchaEnabled);
return Convert.toBool(captchaEnabled,true);
}
/**