diff --git a/my-project-backend/src/main/java/com/example/config/SecurityConfiguration.java b/my-project-backend/src/main/java/com/example/config/SecurityConfiguration.java
index 2db8779..075eae9 100644
--- a/my-project-backend/src/main/java/com/example/config/SecurityConfiguration.java
+++ b/my-project-backend/src/main/java/com/example/config/SecurityConfiguration.java
@@ -56,7 +56,7 @@ public class SecurityConfiguration {
.requestMatchers("/api/auth/**", "/error").permitAll()
.requestMatchers("/images/**").permitAll()
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
- .anyRequest().hasAnyRole(Const.ROLE_DEFAULT)
+ .anyRequest().hasAnyRole(Const.ROLE_DEFAULT, Const.ROLE_ADMIN)
)
.formLogin(conf -> conf
.loginProcessingUrl("/api/auth/login")
diff --git a/my-project-backend/src/main/java/com/example/utils/Const.java b/my-project-backend/src/main/java/com/example/utils/Const.java
index 1ea67f5..8f2b8bb 100644
--- a/my-project-backend/src/main/java/com/example/utils/Const.java
+++ b/my-project-backend/src/main/java/com/example/utils/Const.java
@@ -22,6 +22,7 @@ public final class Const {
public final static String MQ_MAIL = "mail";
//用户角色
public final static String ROLE_DEFAULT = "user";
+ public final static String ROLE_ADMIN = "admin";
//论坛相关
public final static String FORUM_WEATHER_CACHE = "weather:cache:";
public final static String FORUM_IMAGE_COUNTER = "forum:image:";
diff --git a/my-project-backend/src/main/resources/application-dev.yml b/my-project-backend/src/main/resources/application-dev.yml
index e841221..4010740 100644
--- a/my-project-backend/src/main/resources/application-dev.yml
+++ b/my-project-backend/src/main/resources/application-dev.yml
@@ -7,7 +7,7 @@ spring:
mail:
host: smtp.163.com
username: javastudy111@163.com
- password: QGLYGBVECIASGPWQ
+ password: SFxfE39P9Wf2icKi
rabbitmq:
addresses: localhost
username: admin
@@ -44,4 +44,4 @@ spring:
username: 'minio'
password: 'password'
weather:
- key: 7abbc24d3b4443b597a3b3c676e0f221
+ key: 115bcaf74fb24f73844365290d85862b
diff --git a/my-project-frontend/src/App.vue b/my-project-frontend/src/App.vue
index 2ca210c..df664a5 100644
--- a/my-project-frontend/src/App.vue
+++ b/my-project-frontend/src/App.vue
@@ -11,13 +11,16 @@ useDark({
useDark({
onChanged(dark) { useToggle(dark) }
})
-
diff --git a/my-project-frontend/src/components/UserInfo.vue b/my-project-frontend/src/components/UserInfo.vue
new file mode 100644
index 0000000..0fc99bd
--- /dev/null
+++ b/my-project-frontend/src/components/UserInfo.vue
@@ -0,0 +1,88 @@
+
+
+
+
+
+ 回到用户端
+
+
+
+
+
+ 前往管理端
+
+
+
+
+
+
+
{{ store.user.username }}
+
{{ store.user.email }}
+
+
+
+
+
+
+
+
+ 个人设置
+
+
+
+
+
+ 消息列表
+
+
+
+
+
+ 退出登录
+
+
+
+
+
+
+
diff --git a/my-project-frontend/src/router/index.js b/my-project-frontend/src/router/index.js
index d4cd296..0578651 100644
--- a/my-project-frontend/src/router/index.js
+++ b/my-project-frontend/src/router/index.js
@@ -53,6 +53,13 @@ const router = createRouter({
component: () => import('@/views/settings/PrivacySetting.vue')
}
]
+ }, {
+ path: '/admin',
+ name: 'admin',
+ component: () => import('@/views/AdminView.vue'),
+ children: [
+
+ ]
}
]
})
diff --git a/my-project-frontend/src/store/index.js b/my-project-frontend/src/store/index.js
index b91f2c3..b6dc280 100644
--- a/my-project-frontend/src/store/index.js
+++ b/my-project-frontend/src/store/index.js
@@ -17,6 +17,9 @@ export const useStore = defineStore('general', {
}
}
}, getters: {
+ isAdmin() {
+ return this.user.role === 'admin'
+ },
avatarUrl() {
if(this.user.avatar)
return `${axios.defaults.baseURL}/images${this.user.avatar}`
diff --git a/my-project-frontend/src/views/AdminView.vue b/my-project-frontend/src/views/AdminView.vue
new file mode 100644
index 0000000..523480f
--- /dev/null
+++ b/my-project-frontend/src/views/AdminView.vue
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ menu.title }}
+
+
+
+
+
+
+ {{ subMenu.title }}
+ {{ subMenu.tag.name }}
+
+
+
+
+
+
+
+
+
+ Main
+
+
+
+
+
+
diff --git a/my-project-frontend/src/views/IndexView.vue b/my-project-frontend/src/views/IndexView.vue
index 779dd55..9ddd14d 100755
--- a/my-project-frontend/src/views/IndexView.vue
+++ b/my-project-frontend/src/views/IndexView.vue
@@ -1,20 +1,43 @@
@@ -72,10 +92,10 @@ function deleteAllNotification() {
-
+
-
+
消息
@@ -101,34 +121,7 @@ function deleteAllNotification() {
style="width: 100%" plain>清除全部未读消息
-
-
{{ store.user.username }}
-
{{ store.user.email }}
-
-
-
-
-
-
-
-
- 个人设置
-
-
-
-
-
- 消息列表
-
-
-
-
-
- 退出登录
-
-
-
-
+
@@ -138,127 +131,26 @@ function deleteAllNotification() {
:default-active="$route.path"
:default-openeds="['1', '2', '3']"
style="min-height: calc(100vh - 55px)">
-
-
-
-
-
- 校园论坛
-
-
-
-
-
-
- 帖子广场
-
-
-
-
-
-
-
- 失物招领
-
-
-
-
-
-
-
- 校园活动
-
-
-
-
-
-
-
- 表白墙
-
-
-
-
-
-
-
- 海文考研
- 合作机构
-
-
-
-
-
-
-
-
- 探索与发现
-
-
-
-
-
-
- 成绩查询
-
-
-
-
-
-
-
- 班级课程表
-
-
-
-
-
-
-
- 教务通知
-
-
-
-
-
-
-
- 在线图书馆
-
-
-
-
-
-
-
- 预约教室
-
-
-
-
-
-
-
-
- 个人设置
-
-
-
-
-
-
- 个人信息设置
-
-
-
-
-
-
-
- 账号安全设置
-
-
-
+
+
+
+
+
+ {{ menu.title }}
+
+
+
+
+
+
+ {{ subMenu.title }}
+ {{ subMenu.tag.name }}
+
+
+
@@ -320,9 +212,17 @@ function deleteAllNotification() {
.logo {
height: 32px;
+ width: 340px;
+ text-align: left;
+
+ :deep(.el-image__inner) {
+ width: 120px;
+ }
}
.user-info {
+ gap: 20px;
+ width: 340px;
display: flex;
justify-content: flex-end;
align-items: center;
@@ -333,7 +233,6 @@ function deleteAllNotification() {
.profile {
text-align: right;
- margin-right: 20px;
:first-child {
font-size: 18px;