Quellcode durchsuchen

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

zhulizhen1111 vor 4 Jahren
Ursprung
Commit
ffcc6c66e6
6 geänderte Dateien mit 132 neuen und 108 gelöschten Zeilen
  1. 2 2
      package.json
  2. 10 3
      public/index.html
  3. 7 6
      src/api/httputils.js
  4. 91 89
      src/components/404.vue
  5. 16 8
      src/store/index.js
  6. 6 0
      vue.config.js

+ 2 - 2
package.json

@@ -12,9 +12,9 @@
     "dependencies": {
         "@mapbox/geojson-merge": "^1.1.1",
         "@saga-web/base": "2.1.24",
-        "@saga-web/big": "1.0.93",
+        "@saga-web/big": "1.0.95",
         "@saga-web/draw": "2.1.105",
-        "@saga-web/feng-map": "1.0.28",
+        "@saga-web/feng-map": "1.0.29",
         "@saga-web/graph": "2.1.117",
         "ant-design-vue": "^1.4.10",
         "axios": "^0.19.2",

Datei-Diff unterdrückt, da er zu groß ist
+ 10 - 3
public/index.html


+ 7 - 6
src/api/httputils.js

@@ -25,10 +25,10 @@ axiosservice.interceptors.request.use(
         config.withCredentials = true // 允许携带token ,这个是解决跨域产生的相关问题
         let isPreview = null
         let token = store.getters['ssoToken']
-        if(store.getters['isPreview'] == "null" || store.getters['isPreview'] == "" ){
-           isPreview = 'false'
-        }else{
-           isPreview = store.getters['isPreview']
+        if (store.getters['isPreview'] == "null" || store.getters['isPreview'] == "") {
+            isPreview = 'false'
+        } else {
+            isPreview = store.getters['isPreview']
         }
 
         // if (config.url.indexOf('mapapp') < 0) {
@@ -77,9 +77,10 @@ axiosservice.interceptors.response.use(
         return res
     },
     function (err) {
-        if(err.response.status == 401){
+        if (err.response.status == 401) {
+            store.commit('SETISREQUESTtAUTH', 'err');
             router.push({
-                path: '/404',
+                path: '404',
             })
         }
         return Promise.reject(err)

+ 91 - 89
src/components/404.vue

@@ -1,103 +1,105 @@
 <template>
-    <div class='notfond'>
-        <div class='not-img'>
-            <img src='@/assets/imgs/dlsb.png' alt />
-        </div>
-        <div class='not-text' v-if='isrequestAuth=="err"'>
-            <span>您的权限不足……</span>
-            <span>建议您联系管理员开通管理说明书相关权限</span>
-        </div>
-        <div class='not-text' v-else>
-            <span>您的访问出错了!</span>
-            <span>建议您稍后再试,或直接联系管理员解决</span>
-        </div>
-        <div class='not-button' @click='goLogin'>
-            <span>关闭页面</span>
-        </div>
+  <div class="notfond">
+    <div class="not-img">
+      <img src="@/assets/imgs/dlsb.png" alt />
     </div>
+    <div class="not-text" v-if="isrequestAuth=='err'">
+      <span>您的权限不足……</span>
+      <span>建议您联系管理员开通管理说明书相关权限</span>
+    </div>
+    <div class="not-text" v-else>
+      <span>您的访问出错了!</span>
+      <span>建议您稍后再试,或直接联系管理员解决</span>
+    </div>
+    <div class="not-button" @click="goLogin">
+      <span>关闭页面</span>
+    </div>
+  </div>
 </template>
 <script>
-import { mapGetters } from 'vuex'
+import { mapGetters } from "vuex";
 export default {
-    data() {
-        return {}
-    },
-    computed: {
-        ...mapGetters(['isrequestAuth'])
-    },
-    mounted() {},
-    methods: {
-        goLogin() {
-            this.$store.commit('SETSSOTOKEN', null)
-            sessionStorage.setItem('SSOTOKEN', '')
-            let ssoServer = ''
-            if (window.location.host == 'http://glsms.wanda-dev.cn') {
-                ssoServer = 'http://oauth.wanda-dev.cn'
-            } else {
-                ssoServer = 'http://oauth.wanda.cn'
-            }
-            let systemcode = 'CAD156',
-                signal = new Date().getTime(),
-                version = '1.0.0'
-            window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
-            // window.open(`${window.location.href}`, true)
-        }
+  data() {
+    return {};
+  },
+  computed: {
+    ...mapGetters(["isrequestAuth"])
+  },
+  mounted() {
+    sessionStorage.setItem("SSOTOKEN", "");
+  },
+  methods: {
+    goLogin() {
+      this.$store.commit("SETSSOTOKEN", null);
+      sessionStorage.setItem("SSOTOKEN", "");
+      let ssoServer = "";
+      if (process.env.NODE_ENV == "wanda_dev") {
+        ssoServer = "http://oauth.wanda-dev.cn";
+      } else {
+        ssoServer = "http://oauth.wanda.cn";
+      }
+      let systemcode = "CAD156",
+        signal = new Date().getTime(),
+        version = "1.0.0";
+      window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`;
+      // window.open(`${window.location.href}`, true)
     }
-}
+  }
+};
 </script>
 <style lang="less" scoped>
 .notfond {
-    width: 100%;
-    height: 100%;
-    background: rgba(255, 255, 255, 1);
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    flex-direction: column;
-    .not-img {
-        width: 120px;
-        height: 120px;
-        img {
-            width: 100%;
-            height: 100%;
-        }
+  width: 100%;
+  height: 100%;
+  background: rgba(255, 255, 255, 1);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+  .not-img {
+    width: 120px;
+    height: 120px;
+    img {
+      width: 100%;
+      height: 100%;
+    }
+  }
+  .not-text {
+    margin-top: 8px;
+    span {
+      display: block;
+      text-align: center;
     }
-    .not-text {
-        margin-top: 8px;
-        span {
-            display: block;
-            text-align: center;
-        }
-        span:nth-of-type(1) {
-            font-size: 16px;
-            font-family: MicrosoftYaHei;
-            color: rgba(31, 36, 41, 1);
-            line-height: 21px;
-        }
-        span:nth-of-type(2) {
-            margin-top: 4px;
-            font-size: 14px;
-            font-family: MicrosoftYaHei;
-            color: rgba(100, 108, 115, 1);
-            line-height: 19px;
-        }
+    span:nth-of-type(1) {
+      font-size: 16px;
+      font-family: MicrosoftYaHei;
+      color: rgba(31, 36, 41, 1);
+      line-height: 21px;
     }
-    .not-button {
-        margin-top: 32px;
-        width: 80px;
-        height: 32px;
-        background: rgba(255, 255, 255, 1);
-        border: 1px solid rgba(195, 199, 203, 1);
-        border-radius: 4px;
-        cursor: pointer;
-        span {
-            display: block;
-            font-size: 14px;
-            font-family: MicrosoftYaHei;
-            color: rgba(31, 35, 41, 1);
-            line-height: 32px;
-            text-align: center;
-        }
+    span:nth-of-type(2) {
+      margin-top: 4px;
+      font-size: 14px;
+      font-family: MicrosoftYaHei;
+      color: rgba(100, 108, 115, 1);
+      line-height: 19px;
+    }
+  }
+  .not-button {
+    margin-top: 32px;
+    width: 80px;
+    height: 32px;
+    background: rgba(255, 255, 255, 1);
+    border: 1px solid rgba(195, 199, 203, 1);
+    border-radius: 4px;
+    cursor: pointer;
+    span {
+      display: block;
+      font-size: 14px;
+      font-family: MicrosoftYaHei;
+      color: rgba(31, 35, 41, 1);
+      line-height: 32px;
+      text-align: center;
     }
+  }
 }
 </style>

+ 16 - 8
src/store/index.js

@@ -1,7 +1,13 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
-import { login, queryFloor, queryfmapID } from '@/api/login.js'
-import { queryBrand } from '@/api/public.js'
+import {
+    login,
+    queryFloor,
+    queryfmapID
+} from '@/api/login.js'
+import {
+    queryBrand
+} from '@/api/public.js'
 import axios from 'axios'
 import router from '../router'
 
@@ -160,11 +166,13 @@ export default new Vuex.Store({
     },
     actions: {
         // 获取项目列表、userId
-        async getUserInfo({ commit }, palyload) {
+        async getUserInfo({
+            commit
+        }, palyload) {
             console.log('getUserInfo', 1)
             await login({
-                returnTree: true,
-            })
+                    returnTree: true,
+                })
                 .then((res) => {
                     // 获取用户当前权限
                     console.log(res.result)
@@ -189,7 +197,7 @@ export default new Vuex.Store({
                                     commit('SETPLAZENAME', res.treeData[0].cname)
                                 }
                                 router.push({
-                                    path: './home/homepage',
+                                    path: './home/overview',
                                 })
                             } else {
                                 router.push({
@@ -206,7 +214,7 @@ export default new Vuex.Store({
                     // router.push({
                     //     path: '/404',
                     // })
-                    commit('SETISREQUESTtAUTH', err)
+                    // commit('SETISREQUESTtAUTH', err)
                 })
             console.log('getUserInfo', 3)
         },
@@ -245,4 +253,4 @@ export default new Vuex.Store({
         },
     },
     modules: {},
-})
+})

+ 6 - 0
vue.config.js

@@ -70,4 +70,10 @@ module.exports = {
     outputDir: 'wandaBmGuide',
     // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
     assetsDir: 'static',
+    transpileDependencies: [
+        '@saga-web', // 指定对第三方依赖包进行babel-polyfill处理
+        "@ant-design",
+        "element-ui"
+    ],
+    productionSourceMap: false, //
 }