forked from Ivasoft/geovisio-website
add ts interface and fix warning(
This commit is contained in:
@@ -3,7 +3,7 @@ import Header from '@/components/Header.vue'
|
||||
import { RouterView } from 'vue-router'
|
||||
import { useMeta } from 'vue-meta'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import authConfig from './composables/auth.ts'
|
||||
import authConfig from './composables/auth'
|
||||
const { authConf } = authConfig()
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
import axios from 'axios'
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
export default function authConfig(): object {
|
||||
const authConf = ref<object>({})
|
||||
interface UserProfileInterface {
|
||||
url?: string
|
||||
}
|
||||
interface AuthConfigInterface {
|
||||
enabled?: boolean
|
||||
user_profile?: UserProfileInterface
|
||||
}
|
||||
|
||||
export default function authConfig() {
|
||||
const authConf = ref<AuthConfigInterface>({})
|
||||
|
||||
async function getConfig(): Promise<object> {
|
||||
const { data } = await axios.get(
|
||||
|
||||
@@ -17,6 +17,7 @@ axios.defaults.baseURL = import.meta.env.VITE_API_URL
|
||||
const i18n = createI18n({
|
||||
locale: 'fr',
|
||||
fallbackLocale: 'fr',
|
||||
warnHtmlMessage: false,
|
||||
globalInjection: true,
|
||||
legacy: false,
|
||||
messages: {
|
||||
@@ -24,11 +25,7 @@ const i18n = createI18n({
|
||||
}
|
||||
})
|
||||
globalCookiesConfig({
|
||||
expireTimes: '7d',
|
||||
path: '/',
|
||||
domain: import.meta.env.VITE_API_URL,
|
||||
secure: true,
|
||||
sameSite: 'None'
|
||||
expireTimes: '7d'
|
||||
})
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
@@ -92,10 +92,10 @@ import { useCookies } from 'vue3-cookies'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRoute } from 'vue-router'
|
||||
import authConfig from '../composables/auth.ts'
|
||||
const { authConf } = authConfig()
|
||||
import authConfig from '../composables/auth'
|
||||
const { cookies } = useCookies()
|
||||
const { t } = useI18n()
|
||||
const { authConf } = authConfig()
|
||||
const route = useRoute()
|
||||
|
||||
let hrefSection = ref<string>('#sec-2')
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"cypress.config.*",
|
||||
"playwright.config.*"
|
||||
],
|
||||
"extensions": [".js", ".jsx", ".ts", ".tsx"],
|
||||
"compilerOptions": {
|
||||
"types": ["node", "vite/client"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user