forked from filebrowser/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
43 lines (37 loc) · 803 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { sync } from 'vuex-router-sync'
import store from '@/store'
import router from '@/router'
import i18n from '@/i18n'
import Vue from '@/utils/vue'
import { recaptcha, loginPage } from '@/utils/constants'
import { login, validateLogin } from '@/utils/auth'
import App from '@/App'
sync(store, router)
async function start () {
if (loginPage) {
await validateLogin()
} else {
await login('', '', '')
}
if (recaptcha) {
await new Promise (resolve => {
const check = () => {
if (typeof window.grecaptcha === 'undefined') {
setTimeout(check, 100)
} else {
resolve()
}
}
check()
})
}
new Vue({
el: '#app',
store,
router,
i18n,
template: '<App/>',
components: { App }
})
}
start()