mirror of
https://forgejo.merr.is/annika/isl-vue3.git
synced 2025-12-11 10:56:31 -05:00
Trying To Manually Load Config
This commit is contained in:
parent
7171757234
commit
a4c98b1818
1 changed files with 11 additions and 2 deletions
|
|
@ -5,6 +5,8 @@ import { computed, ref, toRaw } from 'vue'
|
|||
import axiosRetry from 'axios-retry'
|
||||
import { apiBaseURL as apiBaseURLKey } from '@/types/ConfigSymbols'
|
||||
import { inject } from 'vue'
|
||||
import { getConfig } from '@/services/siteConfig'
|
||||
import type { Config } from '@/types/Config'
|
||||
|
||||
const BLESSING = 1
|
||||
const INTIMACY = 2
|
||||
|
|
@ -24,7 +26,14 @@ export const usePowerItems = defineStore('powerItems', () => {
|
|||
const BLESSING_POWER_ITEM_STORAGE = 'BLESSING_POWER_ITEM_STORAGE'
|
||||
const FELLOW_POWER_ITEM_STORAGE = 'FELLOW_POWER_ITEM_STORAGE'
|
||||
const INTIMACY_POWER_ITEM_STORAGE = 'INTIMACY_POWER_ITEM_STORAGE'
|
||||
const apiBaseURL = inject(apiBaseURLKey)!
|
||||
let apiBaseURL = inject(apiBaseURLKey)!
|
||||
if (apiBaseURL === undefined) {
|
||||
getConfig().then((conf: Config | null) => {
|
||||
if (conf !== null) {
|
||||
apiBaseURL = conf.apiBaseURL
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(apiBaseURL)
|
||||
//#endregion
|
||||
|
||||
|
|
@ -33,7 +42,7 @@ export const usePowerItems = defineStore('powerItems', () => {
|
|||
const fellowPowerItems = ref(new Map<string, PowerItem>())
|
||||
const intimacyPowerItems = ref(new Map<string, PowerItem>())
|
||||
//#endregion
|
||||
|
||||
|
||||
axiosRetry(axios, {
|
||||
retries: 3,
|
||||
retryDelay: axiosRetry.exponentialDelay
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue