목록개발 (34)
끄적끄적
jwt는 base64 + encodeUri 기반이다. 따라서 한글로 디코딩하기 위해서 아래의 로직 참고 function parseJwt (token) { var base64Url = token.split('.')[1]; var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) { return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); }).join('')); return JSON.parse(jsonPayload); }; 참고 : https://stackoverfl..
timezone 변경 $ date //현재 시간 확인 Thu Dec 13 06:41:49 UTC 2018 $ cat /etc/localtime //시간대 확인 ...UTC $sudo rm /etc/localtime $sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime $ date locale 변경 $ locale // 현재 설정되어있는 locale 확인 $ locale -a //현재 설정가능한 locale 리스트 확인 $ vim /etc/sysconfig/i18n //에디터를 이용해 해당 아래의 내용을 변경 LANG=en_US.UTF-8 ---> LANG=ko_KR.utf8 참고 : https://jungjoongi.com/2018/12/13/aws-ec..
v-html을 통해 콘텐츠를 제공할때 "" 형식의 경우는 막아준다. 그러나 "" 같은 방식으로 간접적으로 표현하게 되면 작동하기때문에 고려가 필요하다. 참고 : https://blog.sqreen.com/xss-in-vue-js/
//출처 : https://github.com/StefanNeuser/vuejs2-summernote-component/blob/master/src/Summernote.js export default { template: '', props: { model: { required: true, }, name: { type: String, required: true, }, height: { type: String, default: '150' }, placeholder:{ type: String, }, lang:{ type:String, } }, mounted() { let config = { height: this.height, lang : this.lang, placeholder : this.placehold..
request 객체 또는 response 객체가 존재하다는 것이 보장되는 상황이라면 아래와 같은 방식으로 객체들을 얻을 수 있다. HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest(); HttpServletResponse response = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getResponse();
- MessageConfig 작성 @Configuration public class MessageConfig implements WebMvcConfigurer { @Bean public LocaleResolver localeResolver() { SessionLocaleResolver localeResolver = new SessionLocaleResolver(); localeResolver.setDefaultLocale(Locale.KOREA); return localeResolver; } @Bean public LocaleChangeInterceptor localeChangeInterceptor() { LocaleChangeInterceptor localeChangeInterceptor = new L..
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); 출처 : https://stackoverflow.com/questions/4565112/javascript-how-to-find-out-if-the-user-browser-is-chrome
dependency 추가 org.springframework.boot spring-boot-starter-cache @EnableCache 추가 @SpringBootApplication @EnableCaching public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } @Cacheable : value에는 캐시의 이름, key 에는 어떤 값을 사용할지를 명시 주의) key값은 객체의 경우 해시코드를 사용하기때문에 이를 고려해야함 @Cacheable(value = "fileList", key = "#boardId") public List getFile..