This commit is contained in:
lunaticbum 2025-08-08 18:04:17 +09:00
parent 9cb482ac6a
commit 0e85db1f1d
4 changed files with 42 additions and 19 deletions

View File

@ -58,6 +58,7 @@ class BumsInterceptor : HandlerInterceptor {
modelAndView.modelMap.put(ApiKeyWordKey, "Def")
println("modelMap 내용 추가 완료: ${modelAndView.modelMap}")
} else {
println("modelAndView가 null이라 모델에 값 추가 불가")
}

View File

@ -16,6 +16,7 @@ import org.springframework.security.authentication.AuthenticationManager
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer
import org.springframework.security.config.http.SessionCreationPolicy
import org.springframework.security.core.AuthenticationException
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
@ -34,12 +35,20 @@ class SecurityConfig(
@Autowired
lateinit var logService: LogService
@Bean
fun webSecurityCustomizer(): WebSecurityCustomizer {
return WebSecurityCustomizer { web ->
web.ignoring().requestMatchers("/blog/post/images/**")
}
}
@Bean
fun filterChain(http: HttpSecurity): SecurityFilterChain {
http.csrf { csrf ->
csrf.ignoringRequestMatchers(
"/user/login.bjx", "/user/joinUser.bjx","/tlg/repotToMe.bjx",
"/blog/post/imageUpload.bjx", "/blog/post.bjx"
"/blog/post/imageUpload.bjx", "/blog/post.bjx",
"/blog/post/images/**"
) // 여기 예외 추가
}.authorizeHttpRequests { auth ->
auth

View File

@ -138,8 +138,7 @@ class UserController {
this.isOk = lResultCode == 0
this.resultCode = lResultCode
this.resultMsg = lResultMsg
this.token = setTokenToCookie(JwtRule.ACCESS_PREFIX.value, tokenData?.tokenKey ?: "", globalEvv.ACCESS_EXPIRATION / 1000).toString().replace("access=","")
this.refresh = setTokenToCookie(JwtRule.REFRESH_PREFIX.value, tokenData?.refreshToken ?: "", globalEvv.REFRESH_EXPIRATION / 1000).toString().replace("refresh=","")
this.token = if (remeberMe) "OK" else ""
}).apply {
}

View File

@ -99,12 +99,24 @@ function save() {
}
function selectLocalImage() {
// 이미지 URL 입력 받기
const url = prompt("이미지 URL을 입력하거나 빈칸으로 두시면 파일 업로드를 합니다.");
if (url) {
// URL이 입력된 경우 이미지 삽입
const range = quill.getSelection(true);
quill.insertEmbed(range.index, 'image', url);
quill.setSelection(range.index + 1);
} else {
// URL이 없거나 취소한 경우 파일 업로드 처리
const input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('accept', 'image/*');
input.click();
console.log("on selectLocalImage")
input.onchange = () => {
input.onchange = async () => {
const file = input.files[0];
if (file) {
const file = input.files[0];
console.log("on selectLocalImage File", file);
if (!file || !file.type.startsWith('image/')) {
@ -112,8 +124,10 @@ function selectLocalImage() {
return;
}
uploadImage(file);
}
};
}
}
function uploadImage(blob) {
const formData = new FormData();