mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
865 B
TypeScript
41 lines
865 B
TypeScript
/*
|
|
* app.config.ts
|
|
* Copyright (C) 2024 veypi <i@veypi.com>
|
|
* 2024-05-31 18:10
|
|
* Distributed under terms of the MIT license.
|
|
*/
|
|
import oaer from '@veypi/oaer'
|
|
|
|
const ready = ref(false)
|
|
oaer.init().then(() => {
|
|
api.apitoken.value = oaer.Token()
|
|
api.apitoken.set_updator(oaer.TokenRefresh)
|
|
console.log('oaer init')
|
|
ready.value = true
|
|
oaer.on('logout', () => {
|
|
api.apitoken.value = ''
|
|
ready.value = false
|
|
})
|
|
}).catch(() => {
|
|
console.log('oaer init error')
|
|
oaer.logout()
|
|
})
|
|
|
|
export default defineAppConfig({
|
|
// host: window.location.protocol + '//' + window.location.host,
|
|
ui: {
|
|
// primary: '#2196f3',
|
|
// gray: '#111'
|
|
},
|
|
ready: computed(() => ready),
|
|
host: window.location.origin,
|
|
layout: {
|
|
theme: '',
|
|
fullscreen: false,
|
|
size: [0, 0],
|
|
header_height: 80,
|
|
footer_height: 16,
|
|
menu_width: 40,
|
|
}
|
|
})
|