Browse Source

feat: 个人中心 相关配置

lanceJiang 1 year ago
parent
commit
4bf2424e59
6 changed files with 40 additions and 17 deletions
  1. 9 6
      .editorconfig
  2. 2 1
      src/lang/en.ts
  3. 2 1
      src/lang/zh-cn.ts
  4. 5 3
      src/layout/components/Navbar.vue
  5. 19 0
      src/router/index.ts
  6. 3 6
      src/views/error-page/401.vue

+ 9 - 6
.editorconfig

@@ -1,14 +1,17 @@
+# Editor configuration, see http://editorconfig.org
 root = true
 
 [*]
 # utf-8编码
-charset=utf-8
+charset = utf-8
 # 控制换行类型(lf | cr | crlf)
-end_of_line=lf
+end_of_line = lf
 # 缩进风格(tab | space)
-indent_style=tab
-indent_size=2
-max_line_length = 150
+indent_style = tab
+indent_size = 2
+# max_line_length = 150
+trim_trailing_whitespace = true
+insert_final_newline = true
 
 # [*.{yml,yaml,json}]
 # indent_style = space
@@ -18,4 +21,4 @@ max_line_length = 150
 # indent_style = space
 # indent_size = 2
 # 去除行首的任意空白字符
-trim_trailing_whitespace = true
+

+ 2 - 1
src/lang/en.ts

@@ -15,7 +15,8 @@ export default {
 		mergeCells: 'Merge Cells',
 		footerSummary: 'Footer Summary',
 		expandTable: 'Expand Table',
-		resizeParentHeightTable: 'ResizeParentHeight Table'
+		resizeParentHeightTable: 'ResizeParentHeight Table',
+		profile: 'User Center'
 	},
 	// 登录页面国际化
 	login: {

+ 2 - 1
src/lang/zh-cn.ts

@@ -15,7 +15,8 @@ export default {
 		mergeCells: '合并单元格',
 		footerSummary: '底部统计',
 		expandTable: '展开行表格',
-		resizeParentHeightTable: '继承父元素高度'
+		resizeParentHeightTable: '继承父元素高度',
+		profile: '用户中心',
 	},
 	// 登录页面国际化
 	login: {

+ 5 - 3
src/layout/components/Navbar.vue

@@ -27,9 +27,7 @@
 
 				<template #dropdown>
 					<el-dropdown-menu>
-						<!--						<router-link to="/">
-							<el-dropdown-item>{{ $t('navbar.dashboard') }}</el-dropdown-item>
-						</router-link>-->
+						<el-dropdown-item @click="goCenter">{{ $t('route.profile') }}</el-dropdown-item>
 						<el-dropdown-item @click="logout">
 							{{ $t('navbar.logout') }}
 						</el-dropdown-item>
@@ -75,6 +73,10 @@ function toggleSideBar() {
 	app.toggleSidebar()
 }
 
+function goCenter() {
+	router.push(`/profile`)
+}
+
 function logout() {
 	ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
 		confirmButtonText: '确定',

+ 19 - 0
src/router/index.ts

@@ -47,6 +47,25 @@ export const constantRoutes: Array<AppRouteRecordRaw> = [
 		component: () => import('@/views/error-page/401.vue'),
 		meta: { hidden: true }
 	},
+	// 用户
+	{
+		path: '/profile',
+		component: Layout,
+		name: 'profile',
+		meta: { hidden: true, title: '用户' },
+		redirect: '/profile/index',
+		children: [
+			{
+				path: 'index',
+				component: () => import('@/views/profile/index.vue'),
+				name: 'profileIndex',
+				meta: {
+					hidden: true,
+					title: 'profile'
+				}
+			}
+		]
+	},
 	// 首页
 	{
 		path: '/',

+ 3 - 6
src/views/error-page/401.vue

@@ -5,15 +5,12 @@
 			<el-col :span="12">
 				<h1 class="text-jumbo text-ginormous">Oops!</h1>
 				<h2>你没有权限去该页面</h2>
-				<h6>如有不满请联系你领导</h6>
+				<!--				<h6>如有不满请联系你领导</h6>-->
 				<ul class="list-unstyled">
-					<li>或者你可以:</li>
+					<li>或者你可以:</li>
 					<li class="link-type">
 						<router-link to="/dashboard"> 回首页 </router-link>
 					</li>
-					<li class="link-type">
-						<a href="https://www.taobao.com/">逛逛淘宝</a>
-					</li>
 				</ul>
 			</el-col>
 			<el-col :span="12">
@@ -30,7 +27,7 @@ export default {
 	name: 'Page401',
 	data() {
 		return {
-			errGif: errGif + '?' + +new Date(),
+			errGif: errGif + '?' + +new Date()
 		}
 	},
 	methods: {