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.
36 lines
603 B
TypeScript
36 lines
603 B
TypeScript
/*
|
|
* main.ts
|
|
* Copyright (C) 2024 veypi <i@veypi.com>
|
|
* 2024-07-04 14:34
|
|
* Distributed under terms of the MIT license.
|
|
*/
|
|
|
|
import './assets/css/oaer.scss'
|
|
import bus from './bus'
|
|
|
|
import ui from './components'
|
|
|
|
export class OAer {
|
|
host: string
|
|
domid?: string
|
|
ui?: ui
|
|
constructor(host: string, domid?: string) {
|
|
this.host = host
|
|
if (domid) {
|
|
this.domid = domid
|
|
this.ui = new ui(document.querySelector(`#${this.domid}`)!)
|
|
}
|
|
}
|
|
login() {
|
|
bus.emit('login')
|
|
}
|
|
logout() {
|
|
bus.emit('logout')
|
|
}
|
|
onlogout(fc: () => void) {
|
|
bus.on('logout', fc)
|
|
}
|
|
}
|
|
|
|
|