diff --git a/package-lock.json b/package-lock.json
index e528da0..7f2a6fd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,6 +13,7 @@
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^1.7.9",
+ "diff": "^7.0.0",
"element-plus": "^2.9.6",
"jquery": "^3.7.1",
"js-cookie": "^3.0.5",
@@ -2479,6 +2480,14 @@
"node": ">=0.10"
}
},
+ "node_modules/diff": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz",
+ "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
"node_modules/dom7": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/dom7/-/dom7-3.0.0.tgz",
diff --git a/package.json b/package.json
index 7f23e0a..9c483c9 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^1.7.9",
+ "diff": "^7.0.0",
"element-plus": "^2.9.6",
"jquery": "^3.7.1",
"js-cookie": "^3.0.5",
diff --git a/public/static/isolatedPages/gungame3d/audio/受击.mp3 b/public/static/isolatedPages/gungame3d/audio/受击.mp3
new file mode 100644
index 0000000..c6b3ec3
Binary files /dev/null and b/public/static/isolatedPages/gungame3d/audio/受击.mp3 differ
diff --git a/public/static/isolatedPages/gungame3d/audio/手枪开枪.mp3 b/public/static/isolatedPages/gungame3d/audio/手枪开枪.mp3
new file mode 100644
index 0000000..06ddcb8
Binary files /dev/null and b/public/static/isolatedPages/gungame3d/audio/手枪开枪.mp3 differ
diff --git a/public/static/isolatedPages/gungame3d/audio/手枪换弹.mp3 b/public/static/isolatedPages/gungame3d/audio/手枪换弹.mp3
new file mode 100644
index 0000000..a036593
Binary files /dev/null and b/public/static/isolatedPages/gungame3d/audio/手枪换弹.mp3 differ
diff --git a/public/static/isolatedPages/gungame3d/index.html b/public/static/isolatedPages/gungame3d/index.html
index 5a4e3db..4e267b9 100644
--- a/public/static/isolatedPages/gungame3d/index.html
+++ b/public/static/isolatedPages/gungame3d/index.html
@@ -2,10 +2,11 @@
+
+
选择游戏模式
+
请选择您的设备类型:
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/demoPages/messageBoard/Board_page.vue b/src/pages/demoPages/messageBoard/Board_page.vue
index 5c86970..e40e37a 100644
--- a/src/pages/demoPages/messageBoard/Board_page.vue
+++ b/src/pages/demoPages/messageBoard/Board_page.vue
@@ -9,7 +9,7 @@ import AuthService from "../../../../services/auth.js";
import PagingController from "../../../components/PagingController.vue";
const messages = ref(store.state.demosLocal.board?.messages || []);
-const amount = ref(store.state.demosLocal.board?.amount || 0);
+const amount = ref(store.state.demosLocal.board?.amount || 1);
const currentPage = ref(store.state.demosLocal.board?.currentPage || 1);
const pageLoading = ref(false);
@@ -30,22 +30,8 @@ async function refreshBoard(page, pageSize) {
PAGE: page,
PAGE_SIZE: pageSize
}).then(res => {
- res.data = res.data.map((msg)=>{
- function stringToFloat(str) {
- // 使用字符串的字符码生成一个基于字符串的唯一数值
- let hash = 0;
- for (let i = 0; i < str.length; i++) {
- hash = (hash << 5) - hash + str.charCodeAt(i); // 位运算来生成哈希
- hash = hash & hash; // 强制转换为32位整数
- }
-
- // 将哈希值映射到0~1之间
- return Math.abs(hash) / (Math.pow(2, 32) - 1);
- }
- msg.likes = Math.round(stringToFloat('random'+ msg.content)*10000);
- return msg;})
messages.value = res.data;
- amount.value = Math.ceil(res.amount / pageSize);
+ amount.value = Math.ceil(res.amount / pageSize) || 1;
store.commit('setLocalDemoValue', {demo: 'board', value: {messages: messages.value}});
store.commit('setLocalDemoValue', {demo: 'board', value: {amount: amount.value}});
})
@@ -79,7 +65,7 @@ async function sendMessage() {
swal.tip('info', '不得为空')
return;
}
- if (userInput.value.trim().length > 500) {
+ if (userInput.value.trim().length > 400) {
swal.tip('error', '太长了!')
return;
}
@@ -146,7 +132,8 @@ onMounted(async () => {
-
正在加载...
+
正在加载...
+
暂无留言
@@ -204,6 +191,7 @@ onMounted(async () => {
display: flex;
flex-direction: column;
justify-content: center;
+ align-items: center;
gap: 15px;
transition: opacity 0.2s ease;
}
diff --git a/src/pages/demoPages/messageBoard/Message.vue b/src/pages/demoPages/messageBoard/Message.vue
index 6aea556..1e86039 100644
--- a/src/pages/demoPages/messageBoard/Message.vue
+++ b/src/pages/demoPages/messageBoard/Message.vue
@@ -62,6 +62,7 @@ async function deleteMessage(id, message) {
\ No newline at end of file
diff --git a/src/pages/toolPages/RequestTester/requestTester_page.vue b/src/pages/toolPages/RequestTester/requestTester_page.vue
index d58c44f..1b03976 100644
--- a/src/pages/toolPages/RequestTester/requestTester_page.vue
+++ b/src/pages/toolPages/RequestTester/requestTester_page.vue
@@ -49,26 +49,19 @@
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index 99bc434..ae9f0d1 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,159 +1,153 @@
-import {createRouter, createWebHistory} from 'vue-router';
+import { createRouter, createWebHistory } from 'vue-router';
import store from '../store';
import AuthService from "../../services/auth.js";
-import Home from '../pages/Home.vue';
-import Login from "../pages/Login.vue";
-import Blog_home from "../pages/Blog_home.vue";
-
-import Account from "../pages/accountPages/Account.vue";
-import Account_selfpage from "../pages/accountPages/Account_selfpage.vue";
-import Account_worksmanage from "../pages/accountPages/Account_worksmanage.vue";
-import Account_setting from "../pages/accountPages/Account_setting.vue";
-import Account_draft from "../pages/accountPages/Account_draft.vue";
-import Account_userInfo from "../pages/accountPages/Account_userInfo.vue";
-import Account_admin_uploadLog from "../pages/accountPages/Account_admin_uploadLog.vue";
-import Account_admin_userManage from "../pages/accountPages/Account_admin_userManage.vue";
-
-import Projects from "../pages/Projects_home.vue";
-
-import Demos_home from "../pages/Demos_home.vue";
-import Board_page from "../pages/demoPages/messageBoard/Board_page.vue";
-import Pod_page from "../pages/demoPages/podExercise/Pod_page.vue";
-import Pod_quiz from "../pages/demoPages/podExercise/Quiz.vue";
-
-import Tools_home from "../pages/Tools_home.vue";
-import GpaCalculator_page from "../pages/toolPages/gpaCalculator/gpaCalculator_page.vue";
-import PdfEx_page from "../pages/toolPages/pdfExtractor/pdfEx_page.vue";
-import RequestTester_page from "../pages/toolPages/RequestTester/requestTester_page.vue";
-
-import About from "../pages/About.vue";
-import Editor from "../pages/blogPages/blogEditor.vue";
-import NotFound from "../pages/errorPages/notFound.vue";
-
-import Test_page from "../pages/Test_page.vue";
-import SingleBlog_page from "../pages/blogPages/SingleBlog_page.vue";
-import SubmitBlog_page from "../pages/blogPages/submitBlogPages/SubmitBlog_page.vue";
import swal from "../utils/sweetalert.js";
-import GunGame_page from "../pages/demoPages/gunGame/gunGame_page.vue";
import api from "../utils/axios.js";
-import EmailVerify from "../pages/EmailVerify.vue";
+
+// 直接引入组件
+import NotFound from '../pages/errorPages/notFound.vue';
+import Home from '../pages/Home.vue';
+import Login from '../pages/Login.vue';
+import EmailVerify from '../pages/EmailVerify.vue';
+import BlogHome from '../pages/Blog_home.vue';
+import SingleBlog from '../pages/blogPages/SingleBlog_page.vue';
+import SubmitBlog from '../pages/blogPages/submitBlogPages/SubmitBlog_page.vue';
+import ProjectsHome from '../pages/Projects_home.vue';
+import DemosHome from '../pages/Demos_home.vue';
+import About from '../pages/About.vue';
+import Account from '../pages/accountPages/Account.vue';
+import AccountSelfPage from '../pages/accountPages/Account_selfpage.vue';
+import AccountWorksManage from '../pages/accountPages/Account_worksmanage.vue';
+import AccountDraft from '../pages/accountPages/Account_draft.vue';
+import AccountSetting from '../pages/accountPages/Account_setting.vue';
+import AccountUserInfo from '../pages/accountPages/Account_userInfo.vue';
+import AccountAdminUploadLog from '../pages/accountPages/Account_admin_uploadLog.vue';
+import AccountAdminUserManage from '../pages/accountPages/Account_admin_userManage.vue';
+import BlogEditor from '../pages/blogPages/blogEditor.vue';
+import TestPage from '../pages/Test_page.vue';
const routes = [
{
path: '/404',
name: '404',
component: NotFound,
- meta: {title: '404'}
+ meta: { title: '404' }
}, {
path: '/',
name: 'Home',
component: Home,
- meta: {title: '首页'}
+ meta: { title: '首页' }
}, {
path: '/login',
name: 'Login',
component: Login,
- meta: {title: '登录'}
+ meta: { title: '登录' }
}, {
path: '/verify',
name: 'EmailVerify',
component: EmailVerify,
- meta: {title: '注册成功'}
+ meta: { title: '注册成功' }
}, {
path: '/blog',
name: 'Blog',
- component: Blog_home,
- meta: {title: '博客'}
+ component: BlogHome,
+ meta: { title: '博客' }
}, {
path: '/blog/:id',
name: 'Blogs',
- component: SingleBlog_page,
- meta: {title: '博客'}
+ component: SingleBlog,
+ meta: { title: '博客' }
}, {
path: '/blog/submit',
name: 'SubmitBlog',
- component: SubmitBlog_page,
- meta: {title: '发布博客'}
- },{
+ component: SubmitBlog,
+ meta: { title: '发布博客' }
+ }, {
path: '/projects',
name: 'Projects',
- component: Projects,
- meta: {title: '项目'}
+ component: ProjectsHome,
+ meta: { title: '项目' }
}, {
path: '/demos',
name: 'Demos',
- component: Demos_home,
- meta: {title: '实例'},
+ component: DemosHome,
+ meta: { title: '实例' },
children: [
{
path: "board",
- component: Board_page,
- meta: {title: '留言板'},
+ component: () => import('../pages/demoPages/messageBoard/Board_page.vue'),
+ meta: { title: '留言板' },
},
{
path: "pod",
- component: Pod_page,
- meta: {title: '做题'},
+ component: () => import('../pages/demoPages/podExercise/Pod_page.vue'),
+ meta: { title: '做题' },
children: [
- {path: "quiz", component: Pod_quiz}
+ { path: "quiz", component: () => import('../pages/demoPages/podExercise/Quiz.vue') }
]
},
{
path: "gungame3d",
- component: GunGame_page,
- meta: {title: '打枪 '},
+ component: () => import('../pages/demoPages/gunGame/gunGame_page.vue'),
+ meta: { title: '打枪' },
+ },
+ {
+ path: "file-sharing",
+ component: () => import('../pages/demoPages/fileSharing/Sharing_page.vue'),
+ meta: { title: '文件共享' },
},
]
}, {
path: '/tools',
name: 'Tools',
- component: Tools_home,
- meta: {title: '小工具'},
+ component: () => import('../pages/Tools_home.vue'),
+ meta: { title: '小工具' },
children: [
- {path: "1", component: GpaCalculator_page},
- {path: "gpa", component: GpaCalculator_page},
- {path: "2", component: PdfEx_page},
- {path: "pdf-extractor", component: PdfEx_page},
- {path: "3", component: RequestTester_page},
- {path: "request-tester", component: RequestTester_page},
+ { path: "1", component: () => import('../pages/toolPages/gpaCalculator/gpaCalculator_page.vue') },
+ { path: "gpa", component: () => import('../pages/toolPages/gpaCalculator/gpaCalculator_page.vue') },
+ { path: "2", component: () => import('../pages/toolPages/pdfExtractor/pdfEx_page.vue') },
+ { path: "pdf-extractor", component: () => import('../pages/toolPages/pdfExtractor/pdfEx_page.vue') },
+ { path: "3", component: () => import('../pages/toolPages/RequestTester/requestTester_page.vue') },
+ { path: "request-tester", component: () => import('../pages/toolPages/RequestTester/requestTester_page.vue') },
]
}, {
path: '/about',
name: 'About',
component: About,
- meta: {title: '关于'},
+ meta: { title: '关于' },
}, {
path: '/account',
component: Account,
- meta: {title: '账户'},
+ meta: { title: '账户' },
children: [
- {path: 'self-page', component: Account_selfpage},
- {path: 'works-manage', component: Account_worksmanage},
- {path: 'draft', component: Account_draft},
- {path: 'setting', component: Account_setting},
- {path: '', component: Account_userInfo},
- {path: 'upload-log', component: Account_admin_uploadLog},
- {path: 'user-management', component: Account_admin_userManage}
+ { path: 'self-page', component: AccountSelfPage },
+ { path: 'works-manage', component: AccountWorksManage },
+ { path: 'draft', component: AccountDraft },
+ { path: 'setting', component: AccountSetting },
+ { path: '', component: AccountUserInfo },
+ { path: 'upload-log', component: AccountAdminUploadLog },
+ { path: 'user-management', component: AccountAdminUserManage }
]
}, {
path: '/editor',
name: 'Editor',
- component: Editor,
- meta: {title: '编辑器'},
- },{
+ component: BlogEditor,
+ meta: { title: '编辑器' },
+ }, {
path: '/test_page',
name: 'Test',
- component: Test_page,
- meta: {title: '测试页'},
+ component: TestPage,
+ meta: { title: '测试页' },
},
];
+// 其余代码保持不变
const router = createRouter({
history: createWebHistory(),
routes
});
-let previousRoute = null
+let previousRoute = null;
router.beforeEach(async (to, from, next) => {
previousRoute = from;
@@ -162,11 +156,6 @@ router.beforeEach(async (to, from, next) => {
store.state.isViewCounted = true;
}
-
- if (/^\/demos\/?$/.test(to.path)) {
- next('/404');
- }
-
if (!store.state.userInfo.uid && store.state.token) {
AuthService.setSelfInfo();
}
@@ -198,13 +187,14 @@ router.beforeEach(async (to, from, next) => {
const title = to.meta?.title;
if (title) {
- document.title = title + ' CYBER'; // 设置页面标题
+ document.title = title + ' CYBER';
}
next();
});
+
export function getPreviousRoute() {
- return previousRoute
+ return previousRoute;
}
export default router;
\ No newline at end of file