diff --git a/.env b/.env index e51db6e..b7f7c2a 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -VITE_API_HOST=192.168.1.125 +VITE_API_HOST=127.0.0.1 VITE_API_PORT=8080 VITE_WS_PATH=/ws \ No newline at end of file diff --git a/src/views/components/menu.ts b/src/views/components/menu.ts index ac68bbd..63d938c 100644 --- a/src/views/components/menu.ts +++ b/src/views/components/menu.ts @@ -1,60 +1,92 @@ -import { useUserStore } from "@/stores/user" - -const menuIcon = [{ - id: 0, - name: '实验操作', - s_icon: '/src/assets/menuIcon/s_home.svg', - n_icon: '/src/assets/menuIcon/n_home.svg', - path: '/graphite', -},{ - id: 1, - name: '日志记录', - s_icon: '/src/assets/menuIcon/s_log.svg', - n_icon: '/src/assets/menuIcon/n_log.svg', - path: '/logRecords', -},{ - id: 2, - name: '实验记录', - s_icon: '/src/assets/menuIcon/s_expe.svg', - n_icon: '/src/assets/menuIcon/n_expe.svg', - path: '/expeRecords', -},{ - id: 3, - name: '加液配置', - s_icon: '/src/assets/menuIcon/s_liquid.svg', - n_icon: '/src/assets/menuIcon/n_liquid.svg', - path: '/addLiquid', -},{ - id: 4, - name: '溶液配置', - s_icon: '/src/assets/menuIcon/s_liquid_config.svg', - n_icon: '/src/assets/menuIcon/n_liquid_config.svg', - path: '/liquidConfig', -},{ - id: 5, - name: '矿石管理', - s_icon: '/src/assets/menuIcon/s_ore.svg', - n_icon: '/src/assets/menuIcon/n_ore.svg', - path: '/oreManage', -},{ - id: 6, - name: '用户管理', - s_icon: '/src/assets/menuIcon/s_user.svg', - n_icon: '/src/assets/menuIcon/n_user.svg', - path: '/userManage', -},{ - id: 7, - name: '调试', - s_icon: '/src/assets/menuIcon/s_debug.svg', - n_icon: '/src/assets/menuIcon/n_debug.svg', - path: '/debug', -}] - -const userStore = useUserStore() +import { useUserStore } from "@/stores/user"; +import s_home from "/src/assets/menuIcon/s_home.svg"; +import n_home from "/src/assets/menuIcon/n_home.svg"; + +import s_log from "/src/assets/menuIcon/s_log.svg"; +import n_log from "/src/assets/menuIcon/n_log.svg"; + +import s_expe from "/src/assets/menuIcon/s_expe.svg"; +import n_expe from "/src/assets/menuIcon/n_expe.svg"; + +import s_liquid from "/src/assets/menuIcon/s_liquid.svg"; +import n_liquid from "/src/assets/menuIcon/n_liquid.svg"; + +import s_liquid_config from "/src/assets/menuIcon/s_liquid_config.svg"; +import n_liquid_config from "/src/assets/menuIcon/n_liquid_config.svg"; + +import s_ore from "/src/assets/menuIcon/s_ore.svg"; +import n_ore from "/src/assets/menuIcon/n_ore.svg"; + +import s_user from "/src/assets/menuIcon/s_user.svg"; +import n_user from "/src/assets/menuIcon/n_user.svg"; + +import s_debug from "/src/assets/menuIcon/s_debug.svg"; +import n_debug from "/src/assets/menuIcon/n_debug.svg"; + +const menuIcon = [ + { + id: 0, + name: "实验操作", + s_icon: s_home, + n_icon: n_home, + path: "/graphite", + }, + { + id: 1, + name: "日志记录", + s_icon: s_log, + n_icon: n_log, + path: "/logRecords", + }, + { + id: 2, + name: "实验记录", + s_icon: s_expe, + n_icon: n_expe, + path: "/expeRecords", + }, + { + id: 3, + name: "加液配置", + s_icon: s_liquid, + n_icon: n_liquid, + path: "/addLiquid", + }, + { + id: 4, + name: "溶液配置", + s_icon: s_liquid_config, + n_icon: n_liquid_config, + path: "/liquidConfig", + }, + { + id: 5, + name: "矿石管理", + s_icon: s_ore, + n_icon: n_ore, + path: "/oreManage", + }, + { + id: 6, + name: "用户管理", + s_icon: s_user, + n_icon: n_user, + path: "/userManage", + }, + { + id: 7, + name: "调试", + s_icon: s_debug, + n_icon: n_debug, + path: "/debug", + }, +]; + +const userStore = useUserStore(); export function getMenus() { - if (userStore.user && userStore.user.role === 1) { - return menuIcon - } else { - return menuIcon.filter(m => m.path !== '/userManage') - } -} \ No newline at end of file + if (userStore.user && userStore.user.role === 1) { + return menuIcon; + } else { + return menuIcon.filter(m => m.path !== "/userManage"); + } +} diff --git a/vite.config.ts b/vite.config.ts index a81163d..689247a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -18,7 +18,7 @@ export default defineConfig({ port: 5174, proxy: { "/api": { - target: "http://192.168.1.125:8080", + target: "http://127.0.0.1:8080", changeOrigin: true, // rewrite: (path) => path.replace(/^\/api/, ''), },