diff --git a/src/core/icons.ts b/src/core/icons.ts index 43fd2374..91b440d4 100644 --- a/src/core/icons.ts +++ b/src/core/icons.ts @@ -71,6 +71,8 @@ import IconUserFollow from "~icons/ri/user-follow-line"; import IconExchange from "~icons/ri/exchange-line"; // @ts-ignore import IconGitHub from "~icons/ri/github-fill"; +// @ts-ignore +import IconUpload from "~icons/ri/upload-cloud-2-line"; export { IconDashboard, @@ -109,4 +111,5 @@ export { IconUserFollow, IconExchange, IconGitHub, + IconUpload, }; diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index c4a49802..15876d5c 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -17,7 +17,7 @@ const moreMenuRootVisible = ref(false); const spotlight = ref(false); const handleRouteToProfile = () => { - router.push({ name: "Profile" }); + router.push({ path: "/users/profile/detail" }); }; diff --git a/src/layouts/UserProfileLayout.vue b/src/layouts/UserProfileLayout.vue new file mode 100644 index 00000000..3e40484c --- /dev/null +++ b/src/layouts/UserProfileLayout.vue @@ -0,0 +1,107 @@ + + diff --git a/src/layouts/index.ts b/src/layouts/index.ts index 82391a85..d1b9f7a3 100644 --- a/src/layouts/index.ts +++ b/src/layouts/index.ts @@ -1,3 +1,4 @@ export { default as BlankLayout } from "./BlankLayout.vue"; export { default as BasicLayout } from "./BasicLayout.vue"; export { default as SystemSettingsLayout } from "./SystemSettingsLayout.vue"; +export { default as UserProfileLayout } from "./UserProfileLayout.vue"; diff --git a/src/router/menus.config.ts b/src/router/menus.config.ts index 222176c0..ec6b3792 100644 --- a/src/router/menus.config.ts +++ b/src/router/menus.config.ts @@ -120,7 +120,7 @@ export const minimenus: MenuItemType[] = [ }, { name: "用户", - path: "/users/profile", + path: "/users/profile/detail", icon: IconUserSettings, }, ]; diff --git a/src/router/routes.config.ts b/src/router/routes.config.ts index b5bc64d2..8a020390 100644 --- a/src/router/routes.config.ts +++ b/src/router/routes.config.ts @@ -1,5 +1,10 @@ import type { RouteRecordRaw } from "vue-router"; -import { BasicLayout, BlankLayout, SystemSettingsLayout } from "@/layouts"; +import { + BasicLayout, + BlankLayout, + SystemSettingsLayout, + UserProfileLayout, +} from "@/layouts"; import Dashboard from "../views/dashboard/Dashboard.vue"; @@ -19,7 +24,9 @@ import PluginList from "../views/system/plugins/PluginList.vue"; import PluginDetail from "../views/system/plugins/PluginDetail.vue"; import UserList from "../views/system/users/UserList.vue"; import RoleList from "../views/system/roles/RoleList.vue"; -import Profile from "../views/system/users/Profile.vue"; +import UserDetail from "../views/system/users/UserDetail.vue"; +import ProfileModification from "../views/system/users/ProfileModification.vue"; +import PasswordChange from "../views/system/users/PasswordChange.vue"; import GeneralSettings from "../views/system/settings/GeneralSettings.vue"; import NotificationSettings from "../views/system/settings/NotificationSettings.vue"; @@ -158,28 +165,51 @@ export const routes: Array = [ }, { path: "/users", - component: BasicLayout, - redirect: "/users/profile", + component: BlankLayout, children: [ { path: "", - name: "Users", - component: UserList, + component: BasicLayout, + children: [ + { + path: "", + name: "Users", + component: UserList, + }, + ], }, { path: ":username", - name: "UserDetail", - component: Profile, + component: UserProfileLayout, + alias: ["profile"], + children: [ + { + path: "detail", + name: "UserDetail", + component: UserDetail, + }, + { + path: "profile-modification", + name: "ProfileModification", + component: ProfileModification, + }, + { + path: "password-change", + name: "PasswordChange", + component: PasswordChange, + }, + ], }, { - path: "profile", - name: "Profile", - component: Profile, - }, - { - path: "roles", - name: "Roles", - component: RoleList, + path: "", + component: BasicLayout, + children: [ + { + path: "roles", + name: "Roles", + component: RoleList, + }, + ], }, ], }, diff --git a/src/views/system/users/PasswordChange.vue b/src/views/system/users/PasswordChange.vue new file mode 100644 index 00000000..58678440 --- /dev/null +++ b/src/views/system/users/PasswordChange.vue @@ -0,0 +1,61 @@ + + diff --git a/src/views/system/users/Profile.vue b/src/views/system/users/Profile.vue deleted file mode 100644 index d9730b18..00000000 --- a/src/views/system/users/Profile.vue +++ /dev/null @@ -1,190 +0,0 @@ - - diff --git a/src/views/system/users/ProfileModification.vue b/src/views/system/users/ProfileModification.vue new file mode 100644 index 00000000..680ceead --- /dev/null +++ b/src/views/system/users/ProfileModification.vue @@ -0,0 +1,79 @@ + + diff --git a/src/views/system/users/UserDetail.vue b/src/views/system/users/UserDetail.vue new file mode 100644 index 00000000..72a49080 --- /dev/null +++ b/src/views/system/users/UserDetail.vue @@ -0,0 +1,80 @@ + +