Vue2_Frontend 수정1...

This commit is contained in:
최준흠 2022-08-30 17:47:31 +09:00
parent 5d437af17f
commit 64838d5e1f
2 changed files with 8 additions and 16 deletions

View File

@ -117,13 +117,10 @@ export default {
return dirty || validated ? valid : null return dirty || validated ? valid : null
}, },
async onSubmit() { async onSubmit() {
const result = await this.callAPI( const result = await this.callAPI('/todo', {
'/todo', title: this.form.title,
JSON.stringify({ content: this.form.content
title: this.form.title, })
content: this.form.content
})
)
if (result !== null) { if (result !== null) {
alert('todo 추가 완료...') alert('todo 추가 완료...')
} else { } else {
@ -149,13 +146,10 @@ export default {
// axios.defaults.headers.post['Access-Control-Allow-Origin'] = // axios.defaults.headers.post['Access-Control-Allow-Origin'] =
// process.env.VUE_APP_BACKEND_HEADERS_Access_Control_Allow_Origin // process.env.VUE_APP_BACKEND_HEADERS_Access_Control_Allow_Origin
// Header // Header
axios.defaults.headers.common = {
Authorization: `Bearer ${localStorage.getItem(
process.env.VUE_APP_LOCALSTORAGE_NAME
)}`
}
const headers = { const headers = {
Authorization: 'Bearer ' + process.env.VUE_APP_LOCALSTORAGE_NAME // Authorization:
// 'Bearer ' +
// localStorage.getItem(process.env.VUE_APP_LOCALSTORAGE_NAME)
} }
return await axios return await axios
.post(url, params, headers) .post(url, params, headers)

View File

@ -51,7 +51,6 @@
:items="rows" :items="rows"
:fields="fields" :fields="fields"
:per-page="perPage" :per-page="perPage"
:current-page="currentPage"
:sort-by.sync="sortBy" :sort-by.sync="sortBy"
:sort-desc.sync="sortDesc" :sort-desc.sync="sortDesc"
:sort-direction="sortDirection" :sort-direction="sortDirection"
@ -249,7 +248,7 @@ export default {
console.log(results) console.log(results)
this.total = results.total this.total = results.total
this.perPage = results.perPage this.perPage = results.perPage
this.page = results.page this.currentPage = results.page
this.rows = results.rows this.rows = results.rows
this.isBusy = false this.isBusy = false
}, },
@ -258,7 +257,6 @@ export default {
}, },
pageClick(bvEvent, page) { pageClick(bvEvent, page) {
console.log(bvEvent) console.log(bvEvent)
// this.currentPage = page
this.getDatas(page) this.getDatas(page)
// bvEvent.preventDefault() // bvEvent.preventDefault()
}, },