Fix api file.
This commit is contained in:
parent
ac8d6bd541
commit
75c9fbdd7f
|
@ -8,13 +8,15 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||
config.public.NUXT_PUBLIC_BASE_URL + config.public.NUXT_PUBLIC_API_NAME;
|
||||
|
||||
const api = $fetch.create({
|
||||
baseURL: baseUrl,
|
||||
// baseURL: baseUrl,
|
||||
onRequest({ request, options, error }) {
|
||||
options.baseURL = baseUrl + options.baseURL;
|
||||
|
||||
// options.baseURL = options.baseURL;
|
||||
|
||||
if (token) {
|
||||
const headers = (options.headers ||= {});
|
||||
|
||||
|
||||
if (Array.isArray(headers)) {
|
||||
headers.push(["Authorization", token]);
|
||||
} else if (headers instanceof Headers) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 9fd2e58067d8293340e72abb6c0085db6dbdc2e1
|
||||
Subproject commit b40221c2319720acff349ceab14de8b3e86c0a87
|
|
@ -1 +1 @@
|
|||
Subproject commit dcff122bbaeb18c88cac0db25d65a0284c0b39dd
|
||||
Subproject commit dce0b4fe6cf7158ac7cb841564e78de33e23d0a3
|
Loading…
Reference in New Issue
Block a user