guhongwei преди 2 години
родител
ревизия
79b104622c

+ 43 - 42
src/router/index.ts

@@ -40,48 +40,49 @@ router.beforeEach((to, from, next) => {
   if (token) {
     // let user = jwt.decode(token);
     const user = {
-      _id: '63b3ed3e404c08bbd8539965',
-      account: 'admin',
-      name: '管理员',
-      role: ['63b641cf35df6c6862df5d39', '63b628199bb09c9905def4cc', '63b64b1f35df6c6862e11bf2', '63b62cac9bb09c9905e14857'],
-      is_super: false,
-      role_type: '1',
-      iat: 1679041521,
-      exp: 1679214321,
-      // _id: '640a8f0d9dfe6bbfaba9880a',
-      // nick_name: '个人账号',
-      // unit: '63b511fa2f41cd4838e478bb',
-      // role: ['63b64ac735df6c6862e0eba3', '63b64b6335df6c6862e13f14', '63b62d2a9bb09c9905e19063'],
-      // role_type: '2',
-      // email: 'guhongwei0324@163.com',
-      // phone: '13174420325',
-      // unit_address: '长春市朝阳区前进大街1244号',
-      // exam_status: '1',
-      // card: '220182199603257019',
-      // basic_id: '640aa44061ebe6235411e9db',
-      // entrances: {
-      //   web: {
-      //     is_use: false,
-      //   },
-      //   project: {
-      //     is_use: true,
-      //     url: 'http://jcdtgl.waityou24.cn/project',
-      //   },
-      //   admin: {
-      //     is_use: true,
-      //     url: 'http://jcdtgl.waityou24.cn/admin',
-      //   },
-      //   basic: {
-      //     is_use: true,
-      //     url: 'http://jcdtgl.waityou24.cn/basic',
-      //   },
-      //   studio: {
-      //     is_use: true,
-      //     url: 'http://jcdtgl.waityou24.cn/studio',
-      //   },
-      // },
-      // iat: 1678686391,
-      // exp: 1678859191,
+      // _id: '63b3ed3e404c08bbd8539965',
+      // account: 'admin',
+      // name: '管理员',
+      // role: ['63b641cf35df6c6862df5d39', '63b628199bb09c9905def4cc', '63b64b1f35df6c6862e11bf2', '63b62cac9bb09c9905e14857'],
+      // is_super: false,
+      // role_type: '1',
+      // iat: 1679041521,
+      // exp: 1679214321,
+
+      _id: '640a8f0d9dfe6bbfaba9880a',
+      nick_name: '个人账号',
+      unit: '63b511fa2f41cd4838e478bb',
+      role: ['63b64ac735df6c6862e0eba3', '63b64b6335df6c6862e13f14', '63b62d2a9bb09c9905e19063'],
+      role_type: '2',
+      email: 'guhongwei0324@163.com',
+      phone: '13174420325',
+      unit_address: '长春市朝阳区前进大街1244号',
+      exam_status: '1',
+      card: '220182199603257019',
+      basic_id: '640aa44061ebe6235411e9db',
+      entrances: {
+        web: {
+          is_use: false,
+        },
+        project: {
+          is_use: true,
+          url: 'http://jcdtgl.waityou24.cn/project',
+        },
+        admin: {
+          is_use: true,
+          url: 'http://jcdtgl.waityou24.cn/admin',
+        },
+        basic: {
+          is_use: true,
+          url: 'http://jcdtgl.waityou24.cn/basic',
+        },
+        studio: {
+          is_use: true,
+          url: 'http://jcdtgl.waityou24.cn/studio',
+        },
+      },
+      iat: 1678686391,
+      exp: 1678859191,
     };
     store.commit('setUser', user, { root: true });
     next();

+ 5 - 32
src/views/home/index.vue

@@ -1,41 +1,14 @@
 <template>
-  <div id="index">
+  <div id="home-1">
     <el-row>
-      <el-col :span="24" class="main">
-        <el-col :span="24" class="main animate__animated animate__backInRight">
-          <home1 v-if="user.role_type == '0' || user.role_type == '1'"></home1>
-          <home2 v-else-if="user.role_type == '2'" :is_role="is_role"></home2>
-          <home3 v-else-if="user.role_type == '3'" :is_role="is_role"></home3>
-        </el-col>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <!-- <web-1></web-1> -->
+        系统首页
       </el-col>
     </el-row>
   </div>
 </template>
 
-<script setup lang="ts">
-import type { Ref } from 'vue';
-import store from '@/stores/counter';
-import { ref, onMounted } from 'vue';
-import home1 from './parts/home-1.vue';
-import home2 from './parts/home-2.vue';
-import home3 from './parts/home-3.vue';
-let user: Ref<{ _id: string; name: string; unit_name: string; nick_name: string; role_type: string }> = ref({
-  _id: '',
-  name: '',
-  unit_name: '',
-  nick_name: '',
-  role_type: '',
-});
-let is_role: Ref<boolean> = ref(true);
-onMounted(async () => {
-  user.value = store.state.user as { _id: string; name: string; unit_name: string; nick_name: string; role_type: string };
-  await searchRole();
-});
-// 查询
-const searchRole = async () => {
-  let role = localStorage.getItem('is_role');
-  if (role) is_role.value = JSON.parse(role);
-};
-</script>
+<script setup lang="ts"></script>
 
 <style scoped></style>

+ 0 - 14
src/views/home/parts/home-1.vue

@@ -1,14 +0,0 @@
-<template>
-  <div id="home-1">
-    <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight">
-        <!-- <web-1></web-1> -->
-        1
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup lang="ts"></script>
-
-<style scoped></style>

+ 0 - 22
src/views/home/parts/home-2.vue

@@ -1,22 +0,0 @@
-<template>
-  <div id="home-2">
-    <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight">
-        <userhome1 v-if="is_role === true"></userhome1>
-        <userhome2 v-else></userhome2>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup lang="ts">
-import { toRefs } from 'vue';
-import userhome1 from './../user/userhome-1.vue';
-import userhome2 from './../user/userhome-2.vue';
-const props = defineProps({
-  is_role: { type: Boolean, default: () => true },
-});
-const { is_role } = toRefs(props);
-</script>
-
-<style scoped></style>

+ 0 - 22
src/views/home/parts/home-3.vue

@@ -1,22 +0,0 @@
-<template>
-  <div id="home-3">
-    <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight">
-        <unithome1 v-if="is_role === true"></unithome1>
-        <unithome2 v-else></unithome2>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup lang="ts">
-import { toRefs } from 'vue';
-import unithome1 from './../unit/unithome-1.vue';
-import unithome2 from './../unit/unithome-2.vue';
-const props = defineProps({
-  is_role: { type: Boolean, default: () => true },
-});
-const { is_role } = toRefs(props);
-</script>
-
-<style scoped></style>

+ 0 - 11
src/views/home/unit/unithome-1.vue

@@ -1,11 +0,0 @@
-<template>
-  <div id="unithome-1">
-    <el-row>
-      <el-col :span="24" class="main"> unithome-1 </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup lang="ts"></script>
-
-<style scoped></style>

+ 0 - 11
src/views/home/unit/unithome-2.vue

@@ -1,11 +0,0 @@
-<template>
-  <div id="unithome-1">
-    <el-row>
-      <el-col :span="24" class="main"> unithome-2 </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup lang="ts"></script>
-
-<style scoped></style>

+ 0 - 11
src/views/home/user/userhome-1.vue

@@ -1,11 +0,0 @@
-<template>
-  <div id="userhome-1">
-    <el-row>
-      <el-col :span="24" class="main"> userhome-1 </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup lang="ts"></script>
-
-<style scoped></style>

+ 0 - 11
src/views/home/user/userhome-2.vue

@@ -1,11 +0,0 @@
-<template>
-  <div id="userhome-2">
-    <el-row>
-      <el-col :span="24" class="main"> userhome-2 </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup lang="ts"></script>
-
-<style scoped></style>