|
@@ -43,7 +43,7 @@ import { store } from './store.js';
|
|
|
import { i18n } from './lang.js';
|
|
import { i18n } from './lang.js';
|
|
|
import { router } from './routes/index.js';
|
|
import { router } from './routes/index.js';
|
|
|
|
|
|
|
|
-import { App, Common } from 'client-base-v4/dist/client-base-v4.js';
|
|
|
|
|
|
|
+import { App, Common, PushMessage } from 'client-base-v4/dist/client-base-v4.js';
|
|
|
import { Notify } from 'pc-component-v3/dist/pc-component-v3.js';
|
|
import { Notify } from 'pc-component-v3/dist/pc-component-v3.js';
|
|
|
window.Common = Common;
|
|
window.Common = Common;
|
|
|
window.Notify = Notify;
|
|
window.Notify = Notify;
|
|
@@ -62,12 +62,29 @@ app.mount('#app');
|
|
|
|
|
|
|
|
window.app = app;
|
|
window.app = app;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+if (window.performance.navigation.type == 1) {
|
|
|
|
|
+ localStorage.setItem('allowSound',false)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 路由钩子
|
|
* 路由钩子
|
|
|
* @param {[type]} (to, from, next [description]
|
|
* @param {[type]} (to, from, next [description]
|
|
|
* @return {[type]} [description]
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
*/
|
|
|
router.beforeEach((to, from, next) => {
|
|
router.beforeEach((to, from, next) => {
|
|
|
|
|
+
|
|
|
|
|
+ let allowSound = localStorage.getItem('allowSound')
|
|
|
|
|
+ if(to.fullPath !== '/login'){
|
|
|
|
|
+ PushMessage.openWebSocket()
|
|
|
|
|
+ if(allowSound && allowSound == 'false'){
|
|
|
|
|
+ PushMessage.messageModal()
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ PushMessage.closeWebsocket()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let funtionAccessDtos = [];
|
|
let funtionAccessDtos = [];
|
|
|
if (to.matched.some(function (item) {
|
|
if (to.matched.some(function (item) {
|
|
|
|
|
|