zhaomiao пре 3 година
родитељ
комит
f9b2e90697
5 измењених фајлова са 68 додато и 67 уклоњено
  1. 1 60
      src/App.vue
  2. 0 1
      src/assets/js/login.js
  3. 63 0
      src/layout/vueapp.vue
  4. 4 5
      src/router/index.js
  5. 0 1
      src/views/headPortrait.vue

+ 1 - 60
src/App.vue

@@ -3,66 +3,7 @@
     id="app"
     :class="'mainTheme-' + this.themeName"
     style="width: 100%; height: 100%"
-    v-loading="$store.state.loading"
-    element-loading-text="拼命加载中"
-    element-loading-spinner="el-icon-loading"
   >
-    <router-view name="rally"></router-view>
-    
-    <el-container style="height: 100%">
-      <el-header style="height: 60px; padding: 0 0px">
-        <headers v-if="this.login"></headers>
-      </el-header>
-
-      <el-container class="fot">
-         
-        <el-aside class="son" :style="this.asidez">
-          <asiders></asiders>
-        </el-aside>
-        <el-main class="sis" :style="this.mainy">
-          <mains></mains>
-        </el-main>
-      </el-container>
-    </el-container>
+  <router-view></router-view>
   </div>
 </template>
-<script>
-import { mapGetters, mapMutations } from "vuex";
-import asiders from "@layout/aside";
-import headers from "@layout/header";
-import mains from "@layout/main";
-export default {
-  computed: {
-    ...mapGetters(["asidez", "mainy", "themeName","login"]),
-  },
-  components: {
-    asiders,
-    headers,
-    mains,
-  },
-  methods: {},
-};
-</script>
-<style lang="scss">
-@import "@assets/css/base.scss";
-</style>
-<style lang="scss" scoped>
-@import "@assets/css/theme.scss";
-.fot {
-  display: flex;
-  flex-direction: row;
-  flex-wrap: nowrap;
-  width: 100%;
-  height: 100%;
-}
-.son {
-  display: flex;
-  width: 10%;
-  height: 100%;
-}
-.sis {
-  display: flex;
-  width: 90%;
-  height: 100%;
-}
-</style>

+ 0 - 1
src/assets/js/login.js

@@ -30,7 +30,6 @@ export default {
           message: '登陆成功',
           type: 'success'
         });
-         this.$store.commit('changelogin',true);
          this.$router.push('/'); // 跳转到首页
 			} else {
         this.$message.error('登录失败');// ui弹窗提示

+ 63 - 0
src/layout/vueapp.vue

@@ -0,0 +1,63 @@
+<template>
+  <div style="width:100%;height:100%"
+  
+    v-loading="$store.state.loading"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+  >
+    <el-container style="height: 100%">
+      <el-header style="height: 60px; padding: 0 0px">
+        <headers></headers>
+      </el-header>
+
+      <el-container class="fot">
+        <el-aside class="son" :style="this.asidez">
+          <asiders></asiders>
+        </el-aside>
+        <el-main class="sis" :style="this.mainy">
+          <mains></mains>
+        </el-main>
+      </el-container>
+    </el-container>
+  </div>
+</template>
+<script>
+import { mapGetters, mapMutations } from "vuex";
+import asiders from "@layout/aside";
+import headers from "@layout/header";
+import mains from "@layout/main";
+export default {
+  computed: {
+    ...mapGetters(["asidez", "mainy", "themeName"]),
+  },
+  components: {
+    asiders,
+    headers,
+    mains,
+  },
+  methods: {},
+};
+</script>
+<style lang="scss">
+@import "@assets/css/base.scss";
+</style>
+<style lang="scss" scoped>
+@import "@assets/css/theme.scss";
+.fot {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  width: 100%;
+  height: 100%;
+}
+.son {
+  display: flex;
+  width: 10%;
+  height: 100%;
+}
+.sis {
+  display: flex;
+  width: 90%;
+  height: 100%;
+}
+</style>

+ 4 - 5
src/router/index.js

@@ -16,7 +16,7 @@ VueRouter.prototype.replace = function replace (location) {
 import main from '@views/main'
 import error404 from '@views/404'
 import login from '@views/login'
-import contents from '@layout/main'
+import contents from '@layout/vueapp'
 // 子路由
 import yRouter from '@router/ylf';
 import lRouter from '@router/lzx';
@@ -50,7 +50,6 @@ const routes = [
     },
     name: 'error404',
     component: error404,
-    components:{rally:error404}
   }
   ,
   {
@@ -59,9 +58,9 @@ const routes = [
       requireAuth: true,
     },
     name: 'login',
-    component: login,
-    components:{rally:login}
-  }
+    component: ()=>import("@views/login"),
+  },
+  
   // { // 健康评价报告 - 临时  /部署单页面
   //   path:'/healthAssessmentDetailed2',
   //   component: r => require.ensure([], () => r(require('@views/healthManagement/healthAssessmentDetailed')), 'healthManagement')

+ 0 - 1
src/views/headPortrait.vue

@@ -43,7 +43,6 @@ export default {
   methods: {
     ...mapMutations("user", ["REMOVE_TOKEN"]),
     loginout() {
-      this.$store.commit('changelogin',false);
       this.REMOVE_TOKEN();
     },
   },