vue2_frontend...
This commit is contained in:
parent
fd6b75ce16
commit
3501f805fa
@ -2,9 +2,6 @@ import authApi from './auth.api'
|
||||
import tokenService from '../service/token.service'
|
||||
const interceptor = (instance) => {
|
||||
//API Request 전 처리용
|
||||
instance.defaults.headers.post['Content-Type'] =
|
||||
'application/x-www-form-urlencoded'
|
||||
instance.defaults.headers.get['Accepts'] = 'application/json'
|
||||
instance.defaults.timeout = 2500
|
||||
|
||||
//Request 처리용
|
||||
@ -13,6 +10,8 @@ const interceptor = (instance) => {
|
||||
const token = tokenService.getAccessToken()
|
||||
if (token) {
|
||||
config['headers'] = {
|
||||
post: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
get: { Accepts: 'application/json' },
|
||||
Authorization: `Bearer ${token}`, // for Spring Boot back-end
|
||||
'x-access-token': token // for Node.js Express back-end
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user