2019-01-05 16:12:09 +00:00
|
|
|
import { sync } from 'vuex-router-sync'
|
|
|
|
import store from '@/store'
|
|
|
|
import router from '@/router'
|
|
|
|
import i18n from '@/i18n'
|
|
|
|
import Vue from '@/utils/vue'
|
2019-02-15 12:56:08 +00:00
|
|
|
import { recaptcha, loginPage } from '@/utils/constants'
|
2019-01-05 16:12:09 +00:00
|
|
|
import { login, validateLogin } from '@/utils/auth'
|
|
|
|
import App from '@/App'
|
|
|
|
|
|
|
|
sync(store, router)
|
|
|
|
|
|
|
|
async function start () {
|
2019-02-15 12:56:08 +00:00
|
|
|
if (loginPage) {
|
2019-01-05 16:12:09 +00:00
|
|
|
await validateLogin()
|
2019-02-15 12:56:08 +00:00
|
|
|
} else {
|
|
|
|
await login('', '', '')
|
2019-01-05 16:12:09 +00:00
|
|
|
}
|
2018-02-01 12:17:04 +00:00
|
|
|
|
2019-01-05 16:12:09 +00:00
|
|
|
if (recaptcha) {
|
|
|
|
await new Promise (resolve => {
|
|
|
|
const check = () => {
|
|
|
|
if (typeof window.grecaptcha === 'undefined') {
|
|
|
|
setTimeout(check, 100)
|
|
|
|
} else {
|
|
|
|
resolve()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
check()
|
|
|
|
})
|
|
|
|
}
|
2018-02-01 12:17:04 +00:00
|
|
|
|
2019-01-05 16:12:09 +00:00
|
|
|
new Vue({
|
|
|
|
el: '#app',
|
|
|
|
store,
|
|
|
|
router,
|
|
|
|
i18n,
|
|
|
|
template: '<App/>',
|
|
|
|
components: { App }
|
|
|
|
})
|
2018-02-01 12:17:04 +00:00
|
|
|
}
|
|
|
|
|
2019-01-05 16:12:09 +00:00
|
|
|
start()
|