cloud-web-corejs 1.0.161 → 1.0.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/App.vue +29 -33
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -1,67 +1,63 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div id="app" :class="{mobileApp:isMobile}">
|
|
3
|
-
<router-view/>
|
|
2
|
+
<div id="app" :class="{ mobileApp: isMobile }">
|
|
3
|
+
<router-view />
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
import settting from
|
|
8
|
+
import settting from "@/settings.js";
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
|
-
name:
|
|
11
|
+
name: "App",
|
|
12
12
|
data() {
|
|
13
13
|
let isMobile = this.getIsMobile();
|
|
14
14
|
return {
|
|
15
|
-
isMobile: isMobile
|
|
16
|
-
}
|
|
15
|
+
isMobile: isMobile,
|
|
16
|
+
};
|
|
17
17
|
},
|
|
18
18
|
created() {
|
|
19
19
|
if (process.env.NODE_ENV !== "development") {
|
|
20
20
|
window.addEventListener(
|
|
21
|
-
|
|
22
|
-
event => {
|
|
23
|
-
var currentPath = window.location.hash.slice(1).split(
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
"hashchange",
|
|
22
|
+
(event) => {
|
|
23
|
+
var currentPath = window.location.hash.slice(1).split("?")[0]; // 获取输入的路由
|
|
24
|
+
if (
|
|
25
|
+
currentPath != "/404" &&
|
|
26
|
+
currentPath != "/login" &&
|
|
27
|
+
this.$router.path !== currentPath
|
|
28
|
+
) {
|
|
29
|
+
this.$store.dispatch("tagsView/delAllViews").then((visitedViews) => {
|
|
30
|
+
this.$router.replace({ path: "/redirect" + "/home" });
|
|
27
31
|
});
|
|
28
32
|
}
|
|
29
33
|
},
|
|
30
34
|
false
|
|
31
35
|
);
|
|
32
36
|
|
|
33
|
-
window.addEventListener(
|
|
37
|
+
window.addEventListener("beforeunload", async (event) => {
|
|
34
38
|
// 如果按下的键是 F5,则执行相应的操作
|
|
35
|
-
var currentPath = window.location.hash.slice(1).split(
|
|
36
|
-
if (
|
|
37
|
-
|
|
39
|
+
var currentPath = window.location.hash.slice(1).split("?")[0]; // 获取输入的路由
|
|
40
|
+
if (
|
|
41
|
+
currentPath != "/home" &&
|
|
42
|
+
currentPath != "/" &&
|
|
43
|
+
currentPath != "/login" &&
|
|
44
|
+
currentPath != "/404"
|
|
45
|
+
) {
|
|
46
|
+
sessionStorage.setItem("toHome", "1");
|
|
38
47
|
}
|
|
39
48
|
});
|
|
40
49
|
}
|
|
41
50
|
|
|
42
|
-
|
|
43
|
-
// 滚动事件变为 scroll
|
|
44
|
-
let title = settting.title;
|
|
45
|
-
if (location.host.indexOf('pcp.sc.5mall.com') == 0 || location.host.indexOf('pipuat.bears.com.cn') == 0) {
|
|
46
|
-
title = '产品创新平台PIP';
|
|
47
|
-
} else if (location.host.indexOf('chigo.sc.5mall.com') == 0) {
|
|
48
|
-
title = '志高营销平台';
|
|
49
|
-
} else if (location.host.indexOf('ngerp.sc.5mall.com') == 0) {
|
|
50
|
-
title = 'NG ERP';
|
|
51
|
-
}
|
|
52
|
-
document.title = title;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
mounted() {
|
|
51
|
+
document.title = settting.title;
|
|
57
52
|
},
|
|
53
|
+
mounted() {},
|
|
58
54
|
methods: {
|
|
59
55
|
getIsMobile() {
|
|
60
56
|
const userAgent = navigator.userAgent;
|
|
61
57
|
const mobileRegex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i;
|
|
62
58
|
return mobileRegex.test(userAgent);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
59
|
+
},
|
|
60
|
+
},
|
|
65
61
|
};
|
|
66
62
|
</script>
|
|
67
63
|
<style>
|