xiaoxian521 преди 3 години
родител
ревизия
f3f9c12edf

+ 0 - 23
mock/echarts.ts

@@ -1,23 +0,0 @@
-import { MockMethod } from "vite-plugin-mock";
-
-// http://mockjs.com/examples.html#Object
-const echartsList = () => {
-  const result = [];
-  for (let index = 0; index < 200; index++) {
-    result.push(["@date", Math.floor(Math.random() * 300)]);
-  }
-  return result;
-};
-
-export default [
-  {
-    url: "/getEchartsInfo",
-    method: "get",
-    response: () => {
-      return {
-        code: 0,
-        info: echartsList()
-      };
-    }
-  }
-] as MockMethod[];

+ 0 - 5
src/api/mock.ts

@@ -4,8 +4,3 @@ import { http } from "../utils/http";
 export const mapJson = (params?: object) => {
   return http.request("get", "/getMapInfo", { params });
 };
-
-// echarts数据
-export const echartsJson = (params?: object) => {
-  return http.request("get", "/getEchartsInfo", { params });
-};

+ 2 - 2
src/layout/components/navbar.vue

@@ -23,7 +23,7 @@ const {
   changeTitle,
   toggleSideBar,
   pureApp,
-  usename,
+  username,
   getDropdownItemStyle
 } = useNav();
 
@@ -94,7 +94,7 @@ function translationEn() {
       <el-dropdown trigger="click">
         <span class="el-dropdown-link">
           <img :src="avatars" />
-          <p>{{ usename }}</p>
+          <p>{{ username }}</p>
         </span>
         <template #dropdown>
           <el-dropdown-menu class="logout">

+ 2 - 2
src/layout/components/sidebar/horizontal.vue

@@ -29,7 +29,7 @@ const {
   changeTitle,
   handleResize,
   menuSelect,
-  usename,
+  username,
   getDropdownItemStyle
 } = useNav();
 
@@ -115,7 +115,7 @@ function translationEn() {
       <el-dropdown trigger="click">
         <span class="el-dropdown-link">
           <img :src="avatars" />
-          <p>{{ usename }}</p>
+          <p>{{ username }}</p>
         </span>
         <template #dropdown>
           <el-dropdown-menu class="logout">

+ 2 - 2
src/layout/components/sidebar/mixNav.vue

@@ -32,7 +32,7 @@ const {
   menuSelect,
   resolvePath,
   pureApp,
-  usename,
+  username,
   getDropdownItemStyle
 } = useNav();
 
@@ -167,7 +167,7 @@ function translationEn() {
       <el-dropdown trigger="click">
         <span class="el-dropdown-link">
           <img :src="avatars" />
-          <p>{{ usename }}</p>
+          <p>{{ username }}</p>
         </span>
         <template #dropdown>
           <el-dropdown-menu class="logout">

+ 2 - 2
src/layout/hooks/nav.ts

@@ -12,7 +12,7 @@ import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
 export function useNav() {
   const pureApp = useAppStoreHook();
   // 用户名
-  const usename: string = storageSession.getItem("info")?.username;
+  const username: string = storageSession.getItem("info")?.username;
 
   // 设置国际化选中后的样式
   const getDropdownItemStyle = computed(() => {
@@ -112,7 +112,7 @@ export function useNav() {
     resolvePath,
     isCollapse,
     pureApp,
-    usename,
+    username,
     getDropdownItemStyle
   };
 }

+ 2 - 2
src/mockProdServer.ts

@@ -1,9 +1,9 @@
 import { createProdMockServer } from "vite-plugin-mock/es/createProdMockServer";
 import mapMock from "../mock/map";
-import echartsMock from "../mock/echarts";
+import systemMock from "../mock/system";
 import asyncRoutesMock from "../mock/asyncRoutes";
 
-export const mockModules = [...mapMock, ...echartsMock, ...asyncRoutesMock];
+export const mockModules = [...mapMock, ...systemMock, ...asyncRoutesMock];
 
 export function setupProdMockServer() {
   createProdMockServer(mockModules);