diff --git a/components.d.ts b/components.d.ts index b340a96..2f5e8c2 100644 --- a/components.d.ts +++ b/components.d.ts @@ -15,22 +15,13 @@ declare module 'vue' { IIcBaselineDataSaverOff: typeof import('~icons/ic/baseline-data-saver-off')['default'] IIcBaselineDownloading: typeof import('~icons/ic/baseline-downloading')['default'] IIcBaselineInfo: typeof import('~icons/ic/baseline-info')['default'] - IIcBaselineLightbulbOutline: typeof import('~icons/ic/baseline-lightbulb-outline')['default'] - IIcBaselineReceiptLong: typeof import('~icons/ic/baseline-receipt-long')['default'] IIcOutlineAccessTime: typeof import('~icons/ic/outline-access-time')['default'] IIcRoundArrowForwardIos: typeof import('~icons/ic/round-arrow-forward-ios')['default'] IonApp: typeof import('@ionic/vue')['IonApp'] IonAvatar: typeof import('@ionic/vue')['IonAvatar'] - IonBackButton: typeof import('@ionic/vue')['IonBackButton'] IonBadge: typeof import('@ionic/vue')['IonBadge'] IonButton: typeof import('@ionic/vue')['IonButton'] IonButtons: typeof import('@ionic/vue')['IonButtons'] - IonCard: typeof import('@ionic/vue')['IonCard'] - IonCardContent: typeof import('@ionic/vue')['IonCardContent'] - IonCardHeader: typeof import('@ionic/vue')['IonCardHeader'] - IonCardSubtitle: typeof import('@ionic/vue')['IonCardSubtitle'] - IonCardTitle: typeof import('@ionic/vue')['IonCardTitle'] - IonChip: typeof import('@ionic/vue')['IonChip'] IonCol: typeof import('@ionic/vue')['IonCol'] IonContent: typeof import('@ionic/vue')['IonContent'] IonDatetime: typeof import('@ionic/vue')['IonDatetime'] @@ -43,15 +34,9 @@ declare module 'vue' { IonInfiniteScrollContent: typeof import('@ionic/vue')['IonInfiniteScrollContent'] IonInput: typeof import('@ionic/vue')['IonInput'] IonItem: typeof import('@ionic/vue')['IonItem'] - IonItemOption: typeof import('@ionic/vue')['IonItemOption'] - IonItemOptions: typeof import('@ionic/vue')['IonItemOptions'] - IonItemSliding: typeof import('@ionic/vue')['IonItemSliding'] IonLabel: typeof import('@ionic/vue')['IonLabel'] IonList: typeof import('@ionic/vue')['IonList'] IonListHeader: typeof import('@ionic/vue')['IonListHeader'] - IonMenu: typeof import('@ionic/vue')['IonMenu'] - IonMenuButton: typeof import('@ionic/vue')['IonMenuButton'] - IonMenuToggle: typeof import('@ionic/vue')['IonMenuToggle'] IonModal: typeof import('@ionic/vue')['IonModal'] IonNote: typeof import('@ionic/vue')['IonNote'] IonPage: typeof import('@ionic/vue')['IonPage'] @@ -62,11 +47,8 @@ declare module 'vue' { IonRouterOutlet: typeof import('@ionic/vue')['IonRouterOutlet'] IonRow: typeof import('@ionic/vue')['IonRow'] IonSearchbar: typeof import('@ionic/vue')['IonSearchbar'] - IonSegment: typeof import('@ionic/vue')['IonSegment'] - IonSegmentButton: typeof import('@ionic/vue')['IonSegmentButton'] IonSelect: typeof import('@ionic/vue')['IonSelect'] IonSelectOption: typeof import('@ionic/vue')['IonSelectOption'] - IonSpinner: typeof import('@ionic/vue')['IonSpinner'] IonTabBar: typeof import('@ionic/vue')['IonTabBar'] IonTabButton: typeof import('@ionic/vue')['IonTabButton'] IonTabs: typeof import('@ionic/vue')['IonTabs'] @@ -86,22 +68,13 @@ declare global { const IIcBaselineDataSaverOff: typeof import('~icons/ic/baseline-data-saver-off')['default'] const IIcBaselineDownloading: typeof import('~icons/ic/baseline-downloading')['default'] const IIcBaselineInfo: typeof import('~icons/ic/baseline-info')['default'] - const IIcBaselineLightbulbOutline: typeof import('~icons/ic/baseline-lightbulb-outline')['default'] - const IIcBaselineReceiptLong: typeof import('~icons/ic/baseline-receipt-long')['default'] const IIcOutlineAccessTime: typeof import('~icons/ic/outline-access-time')['default'] const IIcRoundArrowForwardIos: typeof import('~icons/ic/round-arrow-forward-ios')['default'] const IonApp: typeof import('@ionic/vue')['IonApp'] const IonAvatar: typeof import('@ionic/vue')['IonAvatar'] - const IonBackButton: typeof import('@ionic/vue')['IonBackButton'] const IonBadge: typeof import('@ionic/vue')['IonBadge'] const IonButton: typeof import('@ionic/vue')['IonButton'] const IonButtons: typeof import('@ionic/vue')['IonButtons'] - const IonCard: typeof import('@ionic/vue')['IonCard'] - const IonCardContent: typeof import('@ionic/vue')['IonCardContent'] - const IonCardHeader: typeof import('@ionic/vue')['IonCardHeader'] - const IonCardSubtitle: typeof import('@ionic/vue')['IonCardSubtitle'] - const IonCardTitle: typeof import('@ionic/vue')['IonCardTitle'] - const IonChip: typeof import('@ionic/vue')['IonChip'] const IonCol: typeof import('@ionic/vue')['IonCol'] const IonContent: typeof import('@ionic/vue')['IonContent'] const IonDatetime: typeof import('@ionic/vue')['IonDatetime'] @@ -114,15 +87,9 @@ declare global { const IonInfiniteScrollContent: typeof import('@ionic/vue')['IonInfiniteScrollContent'] const IonInput: typeof import('@ionic/vue')['IonInput'] const IonItem: typeof import('@ionic/vue')['IonItem'] - const IonItemOption: typeof import('@ionic/vue')['IonItemOption'] - const IonItemOptions: typeof import('@ionic/vue')['IonItemOptions'] - const IonItemSliding: typeof import('@ionic/vue')['IonItemSliding'] const IonLabel: typeof import('@ionic/vue')['IonLabel'] const IonList: typeof import('@ionic/vue')['IonList'] const IonListHeader: typeof import('@ionic/vue')['IonListHeader'] - const IonMenu: typeof import('@ionic/vue')['IonMenu'] - const IonMenuButton: typeof import('@ionic/vue')['IonMenuButton'] - const IonMenuToggle: typeof import('@ionic/vue')['IonMenuToggle'] const IonModal: typeof import('@ionic/vue')['IonModal'] const IonNote: typeof import('@ionic/vue')['IonNote'] const IonPage: typeof import('@ionic/vue')['IonPage'] @@ -133,11 +100,8 @@ declare global { const IonRouterOutlet: typeof import('@ionic/vue')['IonRouterOutlet'] const IonRow: typeof import('@ionic/vue')['IonRow'] const IonSearchbar: typeof import('@ionic/vue')['IonSearchbar'] - const IonSegment: typeof import('@ionic/vue')['IonSegment'] - const IonSegmentButton: typeof import('@ionic/vue')['IonSegmentButton'] const IonSelect: typeof import('@ionic/vue')['IonSelect'] const IonSelectOption: typeof import('@ionic/vue')['IonSelectOption'] - const IonSpinner: typeof import('@ionic/vue')['IonSpinner'] const IonTabBar: typeof import('@ionic/vue')['IonTabBar'] const IonTabButton: typeof import('@ionic/vue')['IonTabButton'] const IonTabs: typeof import('@ionic/vue')['IonTabs'] diff --git a/src/api/index.ts b/src/api/index.ts index d2a15ab..294221a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -5,16 +5,18 @@ import { toastController } from "@ionic/vue"; import { i18n } from "@/locales"; import { useMocks } from "@/mocks"; -const client = treaty(window.location.origin, { +const baseURL = import.meta.env.DEV ? window.location.origin : import.meta.env.VITE_API_URL; + +const client = treaty(baseURL, { fetch: { credentials: "include", }, headers() { const token = localStorage.getItem("user-token") || ""; - return { - "Content-Type": "application/json", - "Authorization": token ? `Bearer ${token}` : "", - }; + const headers = new Headers(); + headers.append("Content-Type", "application/json"); + headers.append("Authorization", token ? `Bearer ${token}` : ""); + return headers; }, }); diff --git a/src/auth/index.ts b/src/auth/index.ts index fd19c12..aff64bc 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -9,7 +9,10 @@ import CircleFlagsTw from "~icons/circle-flags/tw"; import CircleFlagsZh from "~icons/circle-flags/zh"; import { i18n } from "@/locales"; +const baseURL = import.meta.env.DEV ? window.location.origin : import.meta.env.VITE_API_URL; + export const authClient = createAuthClient({ + baseURL, fetchOptions: { credentials: "include", }, diff --git a/src/ui/avatar/index.vue b/src/ui/avatar/index.vue index 0f0a14b..b23898e 100644 --- a/src/ui/avatar/index.vue +++ b/src/ui/avatar/index.vue @@ -24,6 +24,6 @@ ion-avatar { --padding: 10px; background-color: #e7f6e1; padding: var(--padding); - border: 2px solid #e3e3e3; + border: 2px solid #e3ffcb; }