Vue2_Frontend 수정1...
This commit is contained in:
parent
5d437af17f
commit
64838d5e1f
@ -117,13 +117,10 @@ export default {
|
||||
return dirty || validated ? valid : null
|
||||
},
|
||||
async onSubmit() {
|
||||
const result = await this.callAPI(
|
||||
'/todo',
|
||||
JSON.stringify({
|
||||
title: this.form.title,
|
||||
content: this.form.content
|
||||
})
|
||||
)
|
||||
const result = await this.callAPI('/todo', {
|
||||
title: this.form.title,
|
||||
content: this.form.content
|
||||
})
|
||||
if (result !== null) {
|
||||
alert('todo 추가 완료...')
|
||||
} else {
|
||||
@ -149,13 +146,10 @@ export default {
|
||||
// axios.defaults.headers.post['Access-Control-Allow-Origin'] =
|
||||
// process.env.VUE_APP_BACKEND_HEADERS_Access_Control_Allow_Origin
|
||||
//전송 Header에 인증키 추가
|
||||
axios.defaults.headers.common = {
|
||||
Authorization: `Bearer ${localStorage.getItem(
|
||||
process.env.VUE_APP_LOCALSTORAGE_NAME
|
||||
)}`
|
||||
}
|
||||
const headers = {
|
||||
Authorization: 'Bearer ' + process.env.VUE_APP_LOCALSTORAGE_NAME
|
||||
// Authorization:
|
||||
// 'Bearer ' +
|
||||
// localStorage.getItem(process.env.VUE_APP_LOCALSTORAGE_NAME)
|
||||
}
|
||||
return await axios
|
||||
.post(url, params, headers)
|
||||
|
||||
@ -51,7 +51,6 @@
|
||||
:items="rows"
|
||||
:fields="fields"
|
||||
:per-page="perPage"
|
||||
:current-page="currentPage"
|
||||
:sort-by.sync="sortBy"
|
||||
:sort-desc.sync="sortDesc"
|
||||
:sort-direction="sortDirection"
|
||||
@ -249,7 +248,7 @@ export default {
|
||||
console.log(results)
|
||||
this.total = results.total
|
||||
this.perPage = results.perPage
|
||||
this.page = results.page
|
||||
this.currentPage = results.page
|
||||
this.rows = results.rows
|
||||
this.isBusy = false
|
||||
},
|
||||
@ -258,7 +257,6 @@ export default {
|
||||
},
|
||||
pageClick(bvEvent, page) {
|
||||
console.log(bvEvent)
|
||||
// this.currentPage = page
|
||||
this.getDatas(page)
|
||||
// bvEvent.preventDefault()
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user