From d03ed3a584cf7a116ae170b1b6882374f76bc909 Mon Sep 17 00:00:00 2001 From: coward Date: Mon, 3 Jun 2024 17:09:25 +0800 Subject: [PATCH] =?UTF-8?q?:art:=E6=96=B0=E5=A2=9E=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 + .env.development | 2 +- src/api/dashboard.ts | 7 ++ src/config/index.ts | 2 +- src/layout/types.ts | 2 +- src/router/index.ts | 2 +- src/router/modules/home.ts | 8 +-- src/views/dashboard/index.vue | 125 ++++++++++++++++++++++++++++++++++ src/views/login/index.vue | 2 +- src/views/welcome/index.vue | 17 ----- 10 files changed, 143 insertions(+), 26 deletions(-) create mode 100644 src/api/dashboard.ts create mode 100644 src/views/dashboard/index.vue delete mode 100644 src/views/welcome/index.vue diff --git a/.env b/.env index 09344c1..50a7579 100644 --- a/.env +++ b/.env @@ -3,3 +3,5 @@ VITE_PORT = 8848 # 是否隐藏首页 隐藏 true 不隐藏 false (勿删除,VITE_HIDE_HOME只需在.env文件配置) VITE_HIDE_HOME = false + +VITE_PUBLIC_PATH = // diff --git a/.env.development b/.env.development index 90d1146..fc93654 100644 --- a/.env.development +++ b/.env.development @@ -2,7 +2,7 @@ VITE_PORT = 8848 # 开发环境读取配置文件路径 -VITE_PUBLIC_PATH = / +VITE_PUBLIC_PATH = // # 开发环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数") VITE_ROUTER_HISTORY = "hash" diff --git a/src/api/dashboard.ts b/src/api/dashboard.ts new file mode 100644 index 0000000..3bf2d8a --- /dev/null +++ b/src/api/dashboard.ts @@ -0,0 +1,7 @@ +import { http } from "@/utils/http"; +import { baseUri } from "@/api/utils"; + +// 获取操作日志 +export const getSystemLog = (params?: object) => { + return http.request("get", baseUri("/dashboard/list"), { params }); +}; diff --git a/src/config/index.ts b/src/config/index.ts index 3294b73..c81d1c4 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -31,7 +31,7 @@ export const getPlatformConfig = async (app: App): Promise => { app.config.globalProperties.$config = getConfig(); return axios({ method: "get", - url: `${VITE_PUBLIC_PATH}/platform-config.json` + url: `${VITE_PUBLIC_PATH}platform-config.json` }) .then(({ data: config }) => { let $config = app.config.globalProperties.$config; diff --git a/src/layout/types.ts b/src/layout/types.ts index 44c309c..1d7b413 100644 --- a/src/layout/types.ts +++ b/src/layout/types.ts @@ -5,7 +5,7 @@ export const routerArrays: Array = VITE_HIDE_HOME === "false" ? [ { - path: "/welcome", + path: "/dashboard", meta: { title: "首页", icon: "ep:home-filled" diff --git a/src/router/index.ts b/src/router/index.ts index 7a28101..e04870e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -121,7 +121,7 @@ router.beforeEach((to: ToRouteType, _from, next) => { } if (tokenObj) { // 开启隐藏首页后在浏览器地址栏手动输入首页welcome路由则跳转到404页面 - if (VITE_HIDE_HOME === "true" && to.fullPath === "/welcome") { + if (VITE_HIDE_HOME === "true" && to.fullPath === "/dashboard") { next({ path: "/error/404" }); } if (_from?.name) { diff --git a/src/router/modules/home.ts b/src/router/modules/home.ts index 842dbfc..f4473cd 100644 --- a/src/router/modules/home.ts +++ b/src/router/modules/home.ts @@ -5,7 +5,7 @@ export default { path: "/", name: "Home", component: Layout, - redirect: "/welcome", + redirect: "/dashboard", meta: { icon: "ep:home-filled", title: "首页", @@ -13,9 +13,9 @@ export default { }, children: [ { - path: "/welcome", - name: "Welcome", - component: () => import("@/views/welcome/index.vue"), + path: "/dashboard", + name: "Dashboard", + component: () => import("@/views/dashboard/index.vue"), meta: { title: "首页", showLink: VITE_HIDE_HOME === "true" ? false : true diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue new file mode 100644 index 0000000..61c5f76 --- /dev/null +++ b/src/views/dashboard/index.vue @@ -0,0 +1,125 @@ + + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index e80ad15..b6e1b8b 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -59,7 +59,7 @@ const onLogin = async (formEl: FormInstance | undefined) => { // 获取后端路由 usePermissionStoreHook().handleWholeMenus([]); addPathMatch(); - router.push("/welcome"); + router.push("/dashboard"); message("登录成功", { type: "success" }); } else { message("登录失败", { type: "error" }); diff --git a/src/views/welcome/index.vue b/src/views/welcome/index.vue deleted file mode 100644 index 49e44a8..0000000 --- a/src/views/welcome/index.vue +++ /dev/null @@ -1,17 +0,0 @@ - - -