cloud-web-corejs 1.0.161 → 1.0.163

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.161",
4
+ "version": "1.0.163",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
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 '@/settings.js';
8
+ import settting from "@/settings.js";
9
9
 
10
10
  export default {
11
- name: 'App',
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
- 'hashchange',
22
- event => {
23
- var currentPath = window.location.hash.slice(1).split('?')[0]; // 获取输入的路由
24
- if (currentPath != '/404' && currentPath != '/login' && this.$router.path !== currentPath) {
25
- this.$store.dispatch('tagsView/delAllViews').then(visitedViews => {
26
- this.$router.replace({path: '/redirect' + '/home'});
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('beforeunload', async event => {
37
+ window.addEventListener("beforeunload", async (event) => {
34
38
  // 如果按下的键是 F5,则执行相应的操作
35
- var currentPath = window.location.hash.slice(1).split('?')[0]; // 获取输入的路由
36
- if (currentPath != '/home' && currentPath != '/' && currentPath != '/login' && currentPath != '/404') {
37
- sessionStorage.setItem('toHome', '1');
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
- window.addEventListener('load', async event => {
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>