에이전트 정보 수신 진행중

Vue + Spring 연동 성공
main
semin.baek 5 months ago
parent 35e7ca3205
commit 5b977d602f

@ -13,14 +13,14 @@ export default defineConfig({
host: 'bsm-lab.dev',
proxy: {
'/app-api/': {
target: 'https://bsm-lab.dev:9443/app-api/',
target: 'https://bsm-lab.dev:17443/app-api/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/app-api/, ''),
secure: false,
ws: true,
},
'/public-api/': {
target: 'https://bsm-lab.dev:9443/public-api/',
target: 'https://bsm-lab.dev:17443/public-api/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/public-api/, ''),
secure: false,

@ -0,0 +1,20 @@
package com.bsmlab.dfx.dfxconsole.framework.config;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequiredArgsConstructor
@Slf4j
public class ForwardController {
/**
* Spring index.html
*/
// @RequestMapping(value = { "/", "/{x:[\\w\\-]+}", "/{x:^(?!api|public-api|app-api).*$}/**" })
@RequestMapping(value = {"/login.html", "main.html"})
public String forward() {
return "forward:/index.html";
}
}

@ -58,4 +58,5 @@ public class PublicApiController {
}
return ResponseEntity.ok(resultMap);
}
}

@ -29,24 +29,17 @@ public class SecurityConfig {
httpSecurity
.csrf(AbstractHttpConfigurer::disable) // REST API 를 제공하는 서비스이므로 Cross Site Request Forgery disable
.authorizeHttpRequests(authorize -> authorize
.requestMatchers("/app-api/**").hasRole("USER")
.requestMatchers("/index.html").hasRole("USER")
.requestMatchers("/app-api/**").authenticated()
.anyRequest().permitAll()
)
.formLogin(form -> form
.loginPage("/login.html")
.loginProcessingUrl("/public-api/loginProcess")
.defaultSuccessUrl("/index.html")
.permitAll()
)
.addFilterAt(this.jsonUsernamePasswordAuthenticationFilter(this.authenticationManager(authenticationConfiguration)), UsernamePasswordAuthenticationFilter.class)
.sessionManagement(session -> session.maximumSessions(1).maxSessionsPreventsLogin(false))
.logout(logout -> logout
.logoutUrl("/public-api/logoutProcess")
.logoutSuccessHandler(this.logoutSuccessHandler())
.invalidateHttpSession(true)
.deleteCookies("JSESSIONID")
)
.addFilterAt(this.jsonUsernamePasswordAuthenticationFilter(this.authenticationManager(authenticationConfiguration)), UsernamePasswordAuthenticationFilter.class)
.sessionManagement(session -> session.maximumSessions(1).maxSessionsPreventsLogin(false));
;
return httpSecurity.build();
}

@ -0,0 +1,11 @@
<!doctype html>
<html lang="ko" data-bs-theme="dark">
<head>
<meta charset="UTF-8" />
<title>Page Not Found</title>
</head>
<body>
<h1>404 - 페이지를 찾을 수 없습니다</h1>
<p>요청하신 페이지가 존재하지 않습니다.</p>
</body>
</html>
Loading…
Cancel
Save