add ts interface and fix warning(

This commit is contained in:
Andreani Jean
2023-05-11 11:32:46 +02:00
parent 53c536361c
commit ed3eee8066
5 changed files with 16 additions and 10 deletions

View File

@@ -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()

View File

@@ -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(

View File

@@ -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)

View File

@@ -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')

View File

@@ -6,6 +6,7 @@
"cypress.config.*",
"playwright.config.*"
],
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"compilerOptions": {
"types": ["node", "vite/client"]
}