-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
49 lines (40 loc) · 1.28 KB
/
main.ts
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
44
45
46
47
48
49
import { createApp } from 'vue'
import App from './App.vue'
import router from './router';
import { IonicVue } from '@ionic/vue';
/* Core CSS required for Ionic components to work properly */
import '@ionic/vue/css/core.css';
/* Basic CSS for apps built with Ionic */
import '@ionic/vue/css/normalize.css';
import '@ionic/vue/css/structure.css';
import '@ionic/vue/css/typography.css';
/* Optional CSS utils that can be commented out */
import '@ionic/vue/css/padding.css';
import '@ionic/vue/css/float-elements.css';
import '@ionic/vue/css/text-alignment.css';
import '@ionic/vue/css/text-transformation.css';
import '@ionic/vue/css/flex-utils.css';
import '@ionic/vue/css/display.css';
/* Theme variables */
import './theme/variables.css';
import { TokenService } from "@/service/token";
import { VueClipboard } from '@soerenmartius/vue3-clipboard'
import { userService } from "@/service/user";
const app = createApp(App)
.use(IonicVue)
.use(router)
.use(VueClipboard)
.use(TokenService.interceptor);
if (userService.getItem() === null) {
router.push({ name: 'Signin' })
} else {
if (TokenService.checkToken()) {
TokenService.pushHeader();
// router.push({ name: 'Home' })
} else {
router.push({ name: 'Signin' })
}
}
router.isReady().then(() => {
app.mount('#app');
});