diff --git a/Build_God_Admin_Frontend/Frontend/src/components/Sidebar.vue b/Build_God_Admin_Frontend/Frontend/src/components/Sidebar.vue index 1696171..a706a25 100644 --- a/Build_God_Admin_Frontend/Frontend/src/components/Sidebar.vue +++ b/Build_God_Admin_Frontend/Frontend/src/components/Sidebar.vue @@ -45,6 +45,11 @@ const menuItems = [ icon: ICONS.bag, label: '背包管理', path: '/admin/bags' + }, + { + icon: ICONS.scrap, + label: '垃圾管理', + path: '/admin/scraps' } ] diff --git a/Build_God_Admin_Frontend/Frontend/src/constants/theme.ts b/Build_God_Admin_Frontend/Frontend/src/constants/theme.ts index 0b05ee0..2944693 100644 --- a/Build_God_Admin_Frontend/Frontend/src/constants/theme.ts +++ b/Build_God_Admin_Frontend/Frontend/src/constants/theme.ts @@ -6,6 +6,7 @@ export const ICONS = { pill: '💊', bag:'🎒', mission: '📜', + scrap: '📜', reward: { pill: '💊', diff --git a/Build_God_Admin_Frontend/Frontend/src/router/index.ts b/Build_God_Admin_Frontend/Frontend/src/router/index.ts index f96b19a..407d7e7 100644 --- a/Build_God_Admin_Frontend/Frontend/src/router/index.ts +++ b/Build_God_Admin_Frontend/Frontend/src/router/index.ts @@ -57,6 +57,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('../views/admin/MissionView.vue'), meta: { title: '任务管理' } }, + { + path: 'scraps', + name: 'scraps', + component: () => import('../views/admin/ScrapView.vue'), + meta: { title: '垃圾管理' } + }, { path: 'bags', name: 'bags', diff --git a/Build_God_Api/Build_God_Api/Program.cs b/Build_God_Api/Build_God_Api/Program.cs index 5cd0f31..c76baa1 100644 --- a/Build_God_Api/Build_God_Api/Program.cs +++ b/Build_God_Api/Build_God_Api/Program.cs @@ -95,6 +95,8 @@ namespace Build_God_Api sqlSugarClient.CodeFirst.InitTables(typeof(CharacterMissionProgress)); sqlSugarClient.CodeFirst.InitTables(typeof(ChatMessage)); sqlSugarClient.CodeFirst.InitTables(typeof(CharacterDailyMission)); + sqlSugarClient.CodeFirst.InitTables(typeof(Scrap)); + sqlSugarClient.CodeFirst.InitTables(typeof(CharacterScrap)); return sqlSugarClient; }); @@ -153,6 +155,7 @@ namespace Build_God_Api builder.Services.AddScoped(); builder.Services.AddHostedService(); builder.Services.AddScoped(); + builder.Services.AddScoped(); builder.Services.AddCors(options => { diff --git a/Build_God_Api/Build_God_Api/appsettings.json b/Build_God_Api/Build_God_Api/appsettings.json index e18d96f..ccdde46 100644 --- a/Build_God_Api/Build_God_Api/appsettings.json +++ b/Build_God_Api/Build_God_Api/appsettings.json @@ -13,5 +13,17 @@ "Issuer": "BuildGod", "Expires": 240, "Audience": "ob" + }, + "profiles": { + "Build_God_Api": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5091", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } } } diff --git a/Build_God_Game/src/router/index.ts b/Build_God_Game/src/router/index.ts index 526731b..74a20dd 100644 --- a/Build_God_Game/src/router/index.ts +++ b/Build_God_Game/src/router/index.ts @@ -44,6 +44,12 @@ const router = createRouter({ name: 'daily-mission', component: () => import('@/views/DailyMissionView.vue'), meta: { requiresAuth: true } + }, + { + path: '/scrap', + name: 'scrap', + component: () => import('@/views/ScrapView.vue'), + meta: { requiresAuth: true } } ] }) diff --git a/Build_God_Game/src/views/GameView.vue b/Build_God_Game/src/views/GameView.vue index 2215cf5..ea16860 100644 --- a/Build_God_Game/src/views/GameView.vue +++ b/Build_God_Game/src/views/GameView.vue @@ -37,6 +37,7 @@ const menuItems = computed(() => [ { label: '背包', icon: '🎒' }, { label: '角色', icon: '👤' }, { label: isTraining.value ? '打坐中' : '打坐', icon: isTraining.value ? '🔥' : '🧘', isTraining: isTraining.value }, + { label: '捡垃圾', icon: '🗑️' }, ]) const handleLogout = () => { @@ -54,6 +55,8 @@ const navigateTo = (item: { label: string }) => { router.push('/training') } else if (item.label === '任务') { router.push('/daily-mission') + } else if (item.label === '捡垃圾') { + router.push('/scrap') } }