|
@@ -1,6 +1,7 @@
|
|
|
import { createStore } from "vuex";
|
|
|
import createPersistedState from "vuex-persistedstate";
|
|
|
import dayjs from "dayjs";
|
|
|
+import { Howl } from "howler";
|
|
|
const store = createStore({
|
|
|
plugins: [createPersistedState()],
|
|
|
state: () => ({
|
|
@@ -8,7 +9,16 @@ const store = createStore({
|
|
|
userData: {
|
|
|
schoolName: ""
|
|
|
},
|
|
|
- lightAudio: null,
|
|
|
+ lightAudio: new Howl({
|
|
|
+ src: "",
|
|
|
+ xhr: {
|
|
|
+ method: 'GET',
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer:' + store.state.token,
|
|
|
+ },
|
|
|
+ withCredentials: true,
|
|
|
+ }
|
|
|
+ }),
|
|
|
lightConfig: {
|
|
|
interval: 5,
|
|
|
directives: 5,
|
|
@@ -44,7 +54,7 @@ const store = createStore({
|
|
|
const userTime: number = dayjs(store.getters.getUserData.expireTime).valueOf();
|
|
|
const currentTime: number = dayjs().valueOf();
|
|
|
//return (userTime - currentTime) > 0
|
|
|
- return true
|
|
|
+ return true
|
|
|
}
|
|
|
},
|
|
|
mutations: {
|