Sfoglia il codice sorgente

登录以及权限页

zhuliu 1 anno fa
parent
commit
d35e94b7c5

+ 58 - 4
src/views/components/errorPage/components/ErrorPageLayout.vue

@@ -1,13 +1,55 @@
 <template>
     <div class="error-page">
-      <div class="error-page-svg">
+      <div style="display:flex;align-items:center;">
+        <div class="error-page-svg">
         <slot />
       </div>
-      <router-link to="/home">
-        <el-button type="primary">回到首页</el-button>
-      </router-link>
+      <div>
+        <div class="ZH">抱歉,您没有访问权限!</div>
+        <div class="EN">
+          <div>
+            <span style="font-size:28px">W</span>
+            <span>e are </span>
+            <span style="font-size:34px">sorry,</span>
+          </div>
+          <div>
+              you have no access permission!
+          </div>
+        </div>
+        <div class="foot">
+          5秒后将自动跳到首页......
+        </div>
+      </div>
+      </div>
+      
+        <el-button type="primary" @click="to">回到首页</el-button>
     </div>
 </template>
+<script>
+export default {
+  data() {
+    return {
+      timer
+    }
+  },
+  mounted() {
+    var that = this
+    this.timer = setTimeout(()=>{
+      that.to()
+    },5000)
+  },
+  methods: {
+    to(){
+      this.$router.push(
+        {
+          path:'/home'
+        }
+      )
+      clearTimeout(this.timer)
+    }
+  },
+}
+</script>
   
 <style lang="scss" scoped>
 .error-page {
@@ -21,5 +63,17 @@
       margin-bottom: 50px;
     }
   }
+  .ZH{
+    font-size: 34px;
+  }
+  .EN{
+    font-family: 'Courier New', Courier, monospace;
+    font-size: 22px;
+    font-weight: 600;
+    color: rgb(255,71,95);
+  }
+  .foot{
+    margin: 20px 0;
+  }
   </style>
   

+ 2 - 2
src/views/layout/mixins/index.js

@@ -79,9 +79,9 @@ export const commonData = {
       })
     },
     //获取权限
-    getPermissionList() {
+    async getPermissionList() {
       var code = "e424f3cc4f8138f0f68bef092b92212f;6a8d3f4d1d5f11eda41c00163e2f0200"
-      this.$api.getPermissionList({ code: code }).then(response => {
+      await this.$api.getPermissionList({ code: code }).then(response => {
         this.$store.commit('SET_PERMISSION', response.data)
       }).catch(error => {
         this.$store.commit('SET_PERMISSION', [])

+ 8 - 1
src/views/login/index.vue

@@ -254,9 +254,16 @@ export default {
            await this.getUserInfo()
             this.getScenario()
             this.getMatter()
-            this.getPermissionList()
+            await this.getPermissionList()
             this.btnLoading = false
           this.$message.success('登录成功')
+          var url = this.$route.query.url
+          if(url){
+            this.$router.push({
+              path: url
+            })
+            return
+          }
           var redirectUrl = localStorage.getItem('redirectUrl')
           if(redirectUrl){
             redirectUrl = JSON.parse(redirectUrl)