Unverified Commit fc7ff5bb authored by ZackYoung's avatar ZackYoung Committed by GitHub

[Fix][web]Fix some bug (#2186)

* fix_some_bug * fix_some_bug
parent b4e1ac13
......@@ -19,6 +19,7 @@
package org.dinky.configure;
import org.dinky.data.annotation.PublicInterface;
import org.dinky.data.constant.BaseConstant;
import org.dinky.interceptor.LocaleChangeInterceptor;
import org.dinky.interceptor.TenantInterceptor;
......@@ -27,6 +28,7 @@ import java.util.Locale;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
......@@ -103,7 +105,18 @@ public class AppConfig implements WebMvcConfigurer {
// .excludePathPatterns("/druid/**")
// .excludePathPatterns("/openapi/**");
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin()))
registry.addInterceptor(
new SaInterceptor(
handler -> {
if (handler instanceof HandlerMethod) {
if (((HandlerMethod) handler)
.getMethodAnnotation(PublicInterface.class)
!= null) {
return;
}
StpUtil.checkLogin();
}
}))
.addPathPatterns("/api/**")
.excludePathPatterns(
"/api/login", "/api/ldap/ldapEnableStatus",
......
......@@ -34,9 +34,9 @@ const FooterContainer: React.FC<FooterContainerProps & StateType> = (props) => {
const [viewJobRunning, setViewJobRunning] = useState(false);
const eventSource = getSseData("/api/sse/getJvmInfo");
const [memDetailInfo, setMemDetailInfo] = useState(memDetails);
useEffect(() => {
const eventSource = getSseData("/api/sse/getJvmInfo");
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
setMemDetailInfo(Number(data["heapUsed"] / 1024 / 1024).toFixed(0) + "/" + Number(data["total"] / 1024 / 1024).toFixed(0) + "M")
......@@ -52,9 +52,9 @@ const FooterContainer: React.FC<FooterContainerProps & StateType> = (props) => {
{
text: <span
style={{backgroundColor: token.colorBgContainer}}><div style={{
width: (1 - (parseInt(memDetails.split("/")[0]) / parseInt(memDetails.split("/")[1]))) * 100 + "%",
width: (1 - (parseInt(memDetailInfo.split("/")[0]) / parseInt(memDetailInfo.split("/")[1]))) * 100 + "%",
backgroundColor: token.colorFill
}}>{memDetails}</div></span>,
}}>{memDetailInfo}</div></span>,
title: l("pages.datastudio.footer.memDetails", "", {
max: memDetailInfo.split("/")[1],
used: memDetailInfo.split("/")[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment