forked from misterGF/CoPilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.vue
More file actions
43 lines (40 loc) · 981 Bytes
/
Copy pathApp.vue
File metadata and controls
43 lines (40 loc) · 981 Bytes
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
<template>
<div>
<router-view></router-view>
<div id="app"></div>
</div>
</template>
<script>
export default {
name: 'App',
data: function () {
return {
section: 'Head',
version: '0.10.0',
callingAPI: false,
serverURI: 'http://10.110.1.10:8080',
caller: this.$http
}
},
methods: {
callAPI: function (method, url, data) {
this.callingAPI = true
url = url || this.serverURI // if no url is passed then inheret local server URI
return this.caller({
url: url,
method: method,
data: data
})
},
logout: function () {
this.$store.commit('SET_USER', null)
this.$store.commit('SET_TOKEN', null)
if (window.localStorage) {
window.localStorage.setItem('user', null)
window.localStorage.setItem('token', null)
}
this.$router.push('/login')
}
}
}
</script>