Browse Source

修改文案

YaolongHan 4 years ago
parent
commit
5cdeae26da
4 changed files with 116 additions and 107 deletions
  1. 1 1
      public/index.html
  2. 6 5
      src/api/httputils.js
  3. 91 91
      src/components/404.vue
  4. 18 10
      src/store/index.js

+ 1 - 1
public/index.html

@@ -123,7 +123,7 @@
         // 指定条问题
         var wd_fm_info = {
             profile: {
-                username: encodeURIComponent('张三')
+                // username: encodeURIComponent('张三')
             }
         };
     </script>

+ 6 - 5
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,7 +77,8 @@ axiosservice.interceptors.response.use(
         return res
     },
     function (err) {
-        if(err.response.status == 401){
+        if (err.response.status == 401) {
+            this.$store.state.commit('SETISREQUESTtAUTH', 'err')
             router.push({
                 path: '/404',
             })

+ 91 - 91
src/components/404.vue

@@ -1,105 +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() {
-        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)
-        }
+  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>

+ 18 - 10
src/store/index.js

@@ -1,16 +1,22 @@
 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'
 
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
-        ssoToken: 'admin:chuyushu',
+        // ssoToken: 'admin:chuyushu',
         // ssoToken: '',
-        // ssoToken: null,
+        ssoToken: null,
         plazaName: '',
         isPreview: false,
         lastRoute: '',
@@ -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: {},
-})
+})