ilk
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { boot } from 'quasar/wrappers'
|
||||
import axios from 'axios'
|
||||
|
||||
export const api = axios.create({
|
||||
baseURL: 'http://localhost:8080/api',
|
||||
timeout: 180000,
|
||||
withCredentials: true // refresh cookie kullanıyorsan kalsın
|
||||
})
|
||||
|
||||
export default boot(() => {
|
||||
api.interceptors.request.use((config) => {
|
||||
const token = localStorage.getItem('token') // ✅ senin authStore key’in
|
||||
|
||||
if (token) {
|
||||
config.headers = config.headers || {}
|
||||
config.headers.Authorization = `Bearer ${token}`
|
||||
}
|
||||
|
||||
return config
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,14 @@
|
||||
// src/boot/dayjs.js
|
||||
import dayjs from 'dayjs'
|
||||
import customParseFormat from 'dayjs/plugin/customParseFormat.js'
|
||||
import relativeTime from 'dayjs/plugin/relativeTime.js'
|
||||
import localizedFormat from 'dayjs/plugin/localizedFormat.js'
|
||||
import 'dayjs/locale/tr.js'
|
||||
|
||||
// 🔹 Plugin’leri aktif et
|
||||
dayjs.extend(customParseFormat)
|
||||
dayjs.extend(relativeTime)
|
||||
dayjs.extend(localizedFormat)
|
||||
dayjs.locale('tr')
|
||||
|
||||
export default dayjs
|
||||
Reference in New Issue
Block a user