From cdd46d912e8fe638c0ee8f6e8789f55377f13343 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Wed, 2 Apr 2025 14:50:29 +0800 Subject: [PATCH] update --- src/api/user.js | 18 +++ src/layouts/AdminLayout.vue | 17 ++- src/router/index.js | 6 + src/views/ChangePassword.vue | 249 +++++++++++++++++++++++++++++++++++ 4 files changed, 287 insertions(+), 3 deletions(-) create mode 100644 src/views/ChangePassword.vue diff --git a/src/api/user.js b/src/api/user.js index 8d6885f..cb30458 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -45,4 +45,22 @@ export function submitUserAuth(data) { method: 'post', data }); +} + +// 发送验证码 +export function sendCode(data) { + return request({ + url: '/api/user/send-code', + method: 'post', + data + }); +} + +// 修改密码 +export function changePassword(data) { + return request({ + url: '/api/user/change-password', + method: 'post', + data + }); } \ No newline at end of file diff --git a/src/layouts/AdminLayout.vue b/src/layouts/AdminLayout.vue index 86e5308..a7b109a 100644 --- a/src/layouts/AdminLayout.vue +++ b/src/layouts/AdminLayout.vue @@ -11,6 +11,9 @@ v-model:openKeys="openKeys" theme="dark" mode="inline" + :inline-collapsed="collapsed" + :defaultOpenKeys="['finance']" + :defaultSelectedKeys="['dashboard']" style="background: #1a1a1a;" > @@ -72,6 +75,9 @@ @@ -109,6 +116,7 @@ import { UserOutlined, ProfileOutlined } from '@ant-design/icons-vue'; +import ChangePassword from '../views/ChangePassword.vue'; export default { name: 'AdminLayout', @@ -119,12 +127,14 @@ export default { CreditCardOutlined, WalletOutlined, UserOutlined, - ProfileOutlined + ProfileOutlined, + ChangePassword }, setup() { const store = useStore(); const route = useRoute(); const router = useRouter(); + const changePasswordVisible = ref(false); const collapsed = computed({ get: () => store.getters.sidebarCollapsed, @@ -132,7 +142,7 @@ export default { }); const userInfo = computed(() => store.getters.userInfo); - const selectedKeys = ref([]); + const selectedKeys = ref(['dashboard']); const openKeys = ref(['finance']); // 获取当前页面标题 @@ -176,7 +186,8 @@ export default { userInfo, handleLogout, currentPageTitle, - route + route, + changePasswordVisible }; } }; diff --git a/src/router/index.js b/src/router/index.js index ac83c29..cf533e0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -65,6 +65,12 @@ const routes = [ name: 'UserAuth', component: () => import('../views/UserAuth.vue'), meta: { title: '实名认证', icon: 'user' } + }, + { + path: 'user/change-password', + name: 'ChangePassword', + component: () => import('../views/ChangePassword.vue'), + meta: { title: '修改密码', icon: 'lock' } } ] }, diff --git a/src/views/ChangePassword.vue b/src/views/ChangePassword.vue new file mode 100644 index 0000000..da950fa --- /dev/null +++ b/src/views/ChangePassword.vue @@ -0,0 +1,249 @@ + + + + + \ No newline at end of file