-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.task.js
More file actions
105 lines (97 loc) · 2.1 KB
/
main.task.js
File metadata and controls
105 lines (97 loc) · 2.1 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import Vue from "vue";
import App from "./App.task.vue";
import VueAxios from "vue-axios";
import axios from "axios";
import routes from "./routes";
import VueRouter from "vue-router";
Vue.use(VueRouter);
const router = new VueRouter({
routes
});
import Vuelidate from "vuelidate";
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-vue/dist/bootstrap-vue.css";
import {
FormGroupPlugin,
FormPlugin,
FormInputPlugin,
ButtonPlugin,
CardPlugin,
NavbarPlugin,
FormSelectPlugin,
AlertPlugin,
ToastPlugin,
LayoutPlugin
} from "bootstrap-vue";
[
FormGroupPlugin,
FormPlugin,
FormInputPlugin,
ButtonPlugin,
CardPlugin,
NavbarPlugin,
FormSelectPlugin,
AlertPlugin,
ToastPlugin,
LayoutPlugin
].forEach((x) => Vue.use(x));
Vue.use(Vuelidate);
axios.interceptors.request.use(
function(config) {
// Do something before request is sent
return config;
},
function(error) {
// Do something with request error
return Promise.reject(error);
}
);
// Add a response interceptor
axios.interceptors.response.use(
function(response) {
// Do something with response data
return response;
},
function(error) {
// Do something with response error
return Promise.reject(error);
}
);
Vue.use(VueAxios, axios);
Vue.config.productionTip = false;
const shared_data = {
username: localStorage.username,
login(username) {
localStorage.setItem("username", username);
this.username = username;
console.log("login", this.username);
},
logout() {
console.log("logout");
localStorage.removeItem("username");
this.username = undefined;
}
};
console.log(shared_data);
// Vue.prototype.$root.store = shared_data;
new Vue({
router,
data() {
return {
store: shared_data
};
},
methods: {
toast(title, content, variant = null, append = false) {
this.$bvToast.toast(`${content}`, {
title: `${title}`,
toaster: "b-toaster-top-center",
variant: variant,
solid: true,
appendToast: append,
autoHideDelay: 3000
});
}
},
render: (h) => h(App)
}).$mount("#app");