inspiteof3665
@inspiteof3665
Reviews Written
4
Average Rating
4.0
Posts
Q&A
cors ์๋ฌ
"json-server": "1.0.0-beta.0" ์์ "json-server": "^0.17.3" ๋ก ๋ค์ด๊ทธ๋ ์ด๋ ํ๋๋ ์ ์์ ์ผ๋ก ๋์ต๋๋ค.
- 0
- 1
- 206
Q&A
๋ฏน์ค์ธ ๊ฐ์ json-server ์ง๋ฌธ๋๋ฆฝ๋๋ค.
json-server ๊ฐ ๋์ค๋ ์์ ์์ ๋ ธํธ์ ์ฌ๋ ค์ฃผ์๋ฉด ์ข๊ฒ ์ต๋๋ค.
- 2
- 2
- 400
Q&A
addTodo Helper ํจ์ ์ ์ฉ
methods: { ...mapMutations(['addOneItem']), addTodo() { if(this.newTodoItem !== ''){ // this.$emit('addTodoItem', this.newTodoItem) // this.$store.commit('addOneItem', this.newTodoItem); this.addOneItem(this.newTodoItem) this.clearInput(); } else { this.showModal = !this.showModal; } }, clearInput() { this.newTodoItem = ""; }},์ด๋ ๊ฒ ์์ ํด์ ์ ์ฉํด๋ณด๊ธด ํ์ต๋๋ค๋ง...์ ์ง 'mapMutations์ addTodo() ๋ก์ง์ด ๋์ด๊ฐ์ผ ํ ๊ฒ๋ง ๊ฐ์ ๋๋์ด ๋๋๋ฐ์. ๊ทธ๋ ๊ฒ ํ๋ ค๋ฉด newTodoItem, showModal ๋ชจ๋ state์์ ๊ด๋ฆฌํด์ผ ํ๋ ๊ฑด์ง์?๊ทธ๋ฆฌ๊ณ mutation์ ์์ด์ผ ํ๋ ๋ก์ง๊ณผ ๊ฐ component์ ์์ด์ผ ํ๋ ๋ก์ง์ ๊ตฌ๋ถํด์ผ ํ๋์ง, ์๋๋ฉด ๋๋๋ก mutation์ ๋ก์ง์ ๊ตฌํํ๋๋ก ํ๋ ๊ฒ์ด vuex๋ฅผ ์ ์ฉํด ๊ฐ๋ฐํ ๋ ๋ ์ ์ ํ ๊ฐ๋ฐ ํจํด์ธ์ง ์์ง ๊ฐ์ด ์ ์ต๋๋ค.best practice๋ ๊ฐ์ด๋๊ฐ ์๋ค๋ฉด ๋ถํ๋๋ฆฝ๋๋ค. ๊ฐ์ฌํฉ๋๋ค.
- 1
- 1
- 231
Q&A
Resource Owner Password ๊ถํ ๋ถ์ฌ ๋ฐฉ์ ๋ฌธ์
์๋ ํ์ธ์. ๋น์ฐํ ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ํจ์ค์๋๋ ๋ฉ๋ชจ๋ฆฌ๊ฐ ์๋ DB์ ์ ์ฅํ ํ ๋ฐ์.์๋์ฝ๋๋ฅผ ๋ณด๋ฉด request์ ์๋ ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ํจ์ค์๋๋ฅผ map์ ์ ์ฅํด์ ์ฌ์ฌ์ฉํฉ๋๋ค. ๊ทธ๋ ๋ค๋ฉด was ๋ฉ๋ชจ๋ฆฌ์ ์ฌ์ฉ์ ์ด๋ฆ๊ณผ ํจ์ค์๋๊ฐ ์ ์ฅ๋ ๊ฒ์ด๊ณ , ํ ์ชฝ was์๋ ์๋ ์ฝ๋๊ฐ ์คํ๋์ด map์ ๋ด๊ธธ ํ ๋ฐ์. ๊ทธ๋ผ๋ค๋ฉด ๋ค๋ฅธ was์ ์ ๊ทผํ์ ๋๋ง๋ค map ์์ผ๋๊น ๋ค์ ๊ถํ ๋ถ์ฌ ๊ณผ์ ์ด ์์๋๋ ๊ฑด์ง๊ฐ ๊ถ๊ธํฉ๋๋ค.Map contextAttributes = new HashMap(); HttpServletRequest request = oAuth2AuthorizeRequest.getAttribute(HttpServletRequest.class.getName()); String username = request.getParameter(OAuth2ParameterNames.USERNAME); String password = request.getParameter(OAuth2ParameterNames.PASSWORD); if (StringUtils.hasText(username) && StringUtils.hasText(password)) { contextAttributes.put(OAuth2AuthorizationContext.USERNAME_ATTRIBUTE_NAME, username); contextAttributes.put(OAuth2AuthorizationContext.PASSWORD_ATTRIBUTE_NAME, password); } return contextAttributes;};์ด ๋ถ๋ถ ์ฝ๋์์
- 0
- 2
- 294




