...
This commit is contained in:
parent
9cb482ac6a
commit
0e85db1f1d
@ -58,6 +58,7 @@ class BumsInterceptor : HandlerInterceptor {
|
|||||||
modelAndView.modelMap.put(ApiKeyWordKey, "Def")
|
modelAndView.modelMap.put(ApiKeyWordKey, "Def")
|
||||||
println("modelMap 내용 추가 완료: ${modelAndView.modelMap}")
|
println("modelMap 내용 추가 완료: ${modelAndView.modelMap}")
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
println("modelAndView가 null이라 모델에 값 추가 불가")
|
println("modelAndView가 null이라 모델에 값 추가 불가")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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.authentication.builders.AuthenticationManagerBuilder
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity
|
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.EnableWebSecurity
|
||||||
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer
|
||||||
import org.springframework.security.config.http.SessionCreationPolicy
|
import org.springframework.security.config.http.SessionCreationPolicy
|
||||||
import org.springframework.security.core.AuthenticationException
|
import org.springframework.security.core.AuthenticationException
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
|
||||||
@ -34,12 +35,20 @@ class SecurityConfig(
|
|||||||
@Autowired
|
@Autowired
|
||||||
lateinit var logService: LogService
|
lateinit var logService: LogService
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
fun webSecurityCustomizer(): WebSecurityCustomizer {
|
||||||
|
return WebSecurityCustomizer { web ->
|
||||||
|
web.ignoring().requestMatchers("/blog/post/images/**")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun filterChain(http: HttpSecurity): SecurityFilterChain {
|
fun filterChain(http: HttpSecurity): SecurityFilterChain {
|
||||||
http.csrf { csrf ->
|
http.csrf { csrf ->
|
||||||
csrf.ignoringRequestMatchers(
|
csrf.ignoringRequestMatchers(
|
||||||
"/user/login.bjx", "/user/joinUser.bjx","/tlg/repotToMe.bjx",
|
"/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 ->
|
}.authorizeHttpRequests { auth ->
|
||||||
auth
|
auth
|
||||||
|
|||||||
@ -138,8 +138,7 @@ class UserController {
|
|||||||
this.isOk = lResultCode == 0
|
this.isOk = lResultCode == 0
|
||||||
this.resultCode = lResultCode
|
this.resultCode = lResultCode
|
||||||
this.resultMsg = lResultMsg
|
this.resultMsg = lResultMsg
|
||||||
this.token = setTokenToCookie(JwtRule.ACCESS_PREFIX.value, tokenData?.tokenKey ?: "", globalEvv.ACCESS_EXPIRATION / 1000).toString().replace("access=","")
|
this.token = if (remeberMe) "OK" else ""
|
||||||
this.refresh = setTokenToCookie(JwtRule.REFRESH_PREFIX.value, tokenData?.refreshToken ?: "", globalEvv.REFRESH_EXPIRATION / 1000).toString().replace("refresh=","")
|
|
||||||
}).apply {
|
}).apply {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,12 +99,24 @@ function save() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function selectLocalImage() {
|
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');
|
const input = document.createElement('input');
|
||||||
input.setAttribute('type', 'file');
|
input.setAttribute('type', 'file');
|
||||||
input.setAttribute('accept', 'image/*');
|
input.setAttribute('accept', 'image/*');
|
||||||
input.click();
|
input.click();
|
||||||
console.log("on selectLocalImage")
|
|
||||||
input.onchange = () => {
|
input.onchange = async () => {
|
||||||
|
const file = input.files[0];
|
||||||
|
if (file) {
|
||||||
const file = input.files[0];
|
const file = input.files[0];
|
||||||
console.log("on selectLocalImage File", file);
|
console.log("on selectLocalImage File", file);
|
||||||
if (!file || !file.type.startsWith('image/')) {
|
if (!file || !file.type.startsWith('image/')) {
|
||||||
@ -112,8 +124,10 @@ function selectLocalImage() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uploadImage(file);
|
uploadImage(file);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function uploadImage(blob) {
|
function uploadImage(blob) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user