From aef2becd0106c946c7417df7cc6918f6637cca24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8C=BF=E5=B0=8F=E5=A4=A9?= <1638245306@qq.com>
Date: Sun, 12 Mar 2023 21:22:22 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83):=20?=
=?UTF-8?q?=E2=9C=A8=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
个人中心完成
---
web/src/i18n/lang/en.ts | 1 +
web/src/i18n/lang/zh-cn.ts | 1 +
web/src/layout/footer/index.vue | 4 +-
web/src/layout/navBars/breadcrumb/user.vue | 3 +-
web/src/router/route.ts | 14 +
web/src/stores/themeConfig.ts | 2 +-
web/src/types/views.d.ts | 15 +-
web/src/views/system/personal/api.ts | 22 ++
web/src/views/system/personal/index.vue | 383 +++++++++++++++++++++
9 files changed, 437 insertions(+), 8 deletions(-)
create mode 100644 web/src/views/system/personal/api.ts
create mode 100644 web/src/views/system/personal/index.vue
diff --git a/web/src/i18n/lang/en.ts b/web/src/i18n/lang/en.ts
index d4213cc..3b6541b 100644
--- a/web/src/i18n/lang/en.ts
+++ b/web/src/i18n/lang/en.ts
@@ -14,6 +14,7 @@ export default {
limitsFrontEndBtn: 'FrontEndBtn',
limitsBackEnd: 'BackEnd',
limitsBackEndEndPage: 'BackEndEndPage',
+ personal: 'personal',
},
staticRoutes: {
signIn: 'signIn',
diff --git a/web/src/i18n/lang/zh-cn.ts b/web/src/i18n/lang/zh-cn.ts
index 96ec7a5..567cb9a 100644
--- a/web/src/i18n/lang/zh-cn.ts
+++ b/web/src/i18n/lang/zh-cn.ts
@@ -25,6 +25,7 @@ export default {
limitsFrontEndBtn: '按钮权限',
limitsBackEnd: '后端控制',
limitsBackEndEndPage: '页面权限',
+ personal: '个人中心',
},
staticRoutes: {
signIn: '登录',
diff --git a/web/src/layout/footer/index.vue b/web/src/layout/footer/index.vue
index 97cffbf..b86f103 100644
--- a/web/src/layout/footer/index.vue
+++ b/web/src/layout/footer/index.vue
@@ -1,8 +1,8 @@
diff --git a/web/src/layout/navBars/breadcrumb/user.vue b/web/src/layout/navBars/breadcrumb/user.vue
index 9c7f2ee..eb7bceb 100644
--- a/web/src/layout/navBars/breadcrumb/user.vue
+++ b/web/src/layout/navBars/breadcrumb/user.vue
@@ -39,7 +39,7 @@
-
+
@@ -68,6 +68,7 @@
{{ $t('message.user.dropdown1') }}
+ {{ $t('message.user.dropdown2') }}
{{ $t('message.user.dropdown6') }}
{{ $t('message.user.dropdown5') }}
diff --git a/web/src/router/route.ts b/web/src/router/route.ts
index 362a918..1c0b1a5 100644
--- a/web/src/router/route.ts
+++ b/web/src/router/route.ts
@@ -32,6 +32,20 @@ export const dynamicRoutes: Array = [
},
children: [],
},
+ {
+ path: '/personal',
+ name: 'personal',
+ component: () => import('/@/views/system/personal/index.vue'),
+ meta: {
+ title: 'message.router.personal',
+ isLink: '',
+ isHide: false,
+ isKeepAlive: true,
+ isAffix: false,
+ isIframe: false,
+ icon: 'iconfont icon-gerenzhongxin',
+ },
+ }
];
/**
diff --git a/web/src/stores/themeConfig.ts b/web/src/stores/themeConfig.ts
index c9f0f14..2bffd4c 100644
--- a/web/src/stores/themeConfig.ts
+++ b/web/src/stores/themeConfig.ts
@@ -96,7 +96,7 @@ export const useThemeConfig = defineStore('themeConfig', {
// 是否开启 TagsView 共用
isShareTagsView: false,
// 是否开启 Footer 底部版权信息
- isFooter: false,
+ isFooter: true,
// 是否开启灰色模式
isGrayscale: false,
// 是否开启色弱模式
diff --git a/web/src/types/views.d.ts b/web/src/types/views.d.ts
index 9e97f77..2e6d9cd 100644
--- a/web/src/types/views.d.ts
+++ b/web/src/types/views.d.ts
@@ -17,12 +17,19 @@ declare type PersonalState = {
newsInfoList: NewInfo[];
recommendList: Recommend[];
personalForm: {
+ username: string;
name: string;
email: string;
- autograph: string;
- occupation: string;
- phone: string;
- sex: string;
+ mobile: string;
+ gender: number | string;
+ dept_info: {
+ dept_id: number;
+ dept_name: string;
+ }
+ role_info: [{
+ id: number;
+ name: string;
+ }]
};
};
diff --git a/web/src/views/system/personal/api.ts b/web/src/views/system/personal/api.ts
new file mode 100644
index 0000000..2bcf839
--- /dev/null
+++ b/web/src/views/system/personal/api.ts
@@ -0,0 +1,22 @@
+import { request } from '/@/utils/service';
+import { PageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';
+export function GetUserInfo(query: PageQuery) {
+ return request({
+ url: '/api/system/user/user_info/',
+ method: 'get',
+ params: query
+ });
+}
+
+
+/**
+ * 更新用户信息
+ * @param data
+ */
+export function updateUserInfo(data: AddReq) {
+ return request({
+ url: '/api/system/user/update_user_info/',
+ method: 'put',
+ data: data
+ })
+}
diff --git a/web/src/views/system/personal/index.vue b/web/src/views/system/personal/index.vue
new file mode 100644
index 0000000..bd512cb
--- /dev/null
+++ b/web/src/views/system/personal/index.vue
@@ -0,0 +1,383 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ currentTime }},{{state.personalForm.username}},生活变的再糟糕,也不妨碍我变得更好!
+
+
+
+ 昵称:
+ {{state.personalForm.name}}
+
+
+ 部门:
+ {{state.personalForm.dept_info.dept_name}}
+
+
+
+
+
+
+ 角色:
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 消息通知
+ 更多
+
+
+
+
+
+
+
+
+ 基本信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 更新个人信息
+
+
+
+
+
+ 账号安全
+
+
+
+
+
密保手机
+
已绑定手机:{{state.personalForm.mobile}}
+
+
+
+
+
+
+
+
+
+
+
绑定邮箱
+
已绑定邮箱:{{state.personalForm.email}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+