diff --git a/module/server/index.js b/module/server/index.js index 27d17c4..852470e 100644 --- a/module/server/index.js +++ b/module/server/index.js @@ -1,6 +1,7 @@ import Koa from 'koa'; import Router from 'koa-router'; import config from "./config/index.js" +import koaStatic from 'koa-static'; const app = new Koa(); const router = new Router(); @@ -19,9 +20,10 @@ router.get('/api/config', (ctx) => { }) app.use(router.routes()); app.use(router.allowedMethods()); +app.use(koaStatic('/www')) const PORT = process.env.PORT || 3001; app.listen(PORT, () => { console.log(`Koa server is running on port ${PORT}`); -}); \ No newline at end of file +}); diff --git a/module/server/package.json b/module/server/package.json index 8dd043c..36eeb0a 100644 --- a/module/server/package.json +++ b/module/server/package.json @@ -6,10 +6,11 @@ "type": "module", "scripts": { "start": "node index.js", - "dev": "node index.js" + "dev": "nodemon index.js" }, "dependencies": { "koa": "^2.15.0", - "koa-router": "^12.0.0" + "koa-router": "^12.0.0", + "koa-static": "^5.0.0" } -} \ No newline at end of file +} diff --git a/index.html b/module/web/index.html similarity index 93% rename from index.html rename to module/web/index.html index f5e45f1..9e9d310 100644 --- a/index.html +++ b/module/web/index.html @@ -18,6 +18,6 @@
- + diff --git a/module/web/package.json b/module/web/package.json index 914e50a..b44a086 100644 --- a/module/web/package.json +++ b/module/web/package.json @@ -1,8 +1,19 @@ { - "name": "web", + "name": "chuanqi-web", "private": true, + "version": "0.0.0", "scripts": { - "dev": "cd ../.. && pnpm dev", - "build": "cd ../.. && pnpm build" + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "axios": "^1.12.2", + "vue": "^3.5.21", + "vue-router": "^4.5.1" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.1", + "vite": "^7.1.7" } } diff --git a/src/App.vue b/module/web/src/App.vue similarity index 100% rename from src/App.vue rename to module/web/src/App.vue diff --git a/src/assets/css/index.scss b/module/web/src/assets/css/index.scss similarity index 89% rename from src/assets/css/index.scss rename to module/web/src/assets/css/index.scss index f6219d2..c9449ab 100644 --- a/src/assets/css/index.scss +++ b/module/web/src/assets/css/index.scss @@ -73,18 +73,6 @@ $directions: ( .w50v{width: 50vw!important;} .h50v{height: 50vh!important;} -.no-devices{ - background-image: url("../assets/no-devices.png"); - background-repeat: no-repeat; - background-position: 50% 38.2%; /* 纵轴38.2% */ - background-size: auto 40%; - text-align: center; - color: #888; - display: flex; - justify-content: center; /* 水平居中 */ - padding-top: calc( 45% + 16px); -} - /* Chrome, Edge, Safari, Opera */ input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { diff --git a/src/assets/css/layout.scss b/module/web/src/assets/css/layout.scss similarity index 100% rename from src/assets/css/layout.scss rename to module/web/src/assets/css/layout.scss diff --git a/src/assets/vue.svg b/module/web/src/assets/vue.svg similarity index 100% rename from src/assets/vue.svg rename to module/web/src/assets/vue.svg diff --git a/src/components/loading.vue b/module/web/src/components/loading.vue similarity index 100% rename from src/components/loading.vue rename to module/web/src/components/loading.vue diff --git a/src/config.js b/module/web/src/config.js similarity index 100% rename from src/config.js rename to module/web/src/config.js diff --git a/src/main.js b/module/web/src/main.js similarity index 94% rename from src/main.js rename to module/web/src/main.js index 8d3b1b6..cb6ca4e 100644 --- a/src/main.js +++ b/module/web/src/main.js @@ -1,7 +1,7 @@ import {createApp} from 'vue' import './style.css' import App from './App.vue' -import router from './router' +import router from './router/index.js' // window.external?.OpenGameWindowNew(window.location.href, '', '', '', false); document.onkeydown = document.onkeyup = document.onkeypress = function (e) { diff --git a/src/router/index.js b/module/web/src/router/index.js similarity index 100% rename from src/router/index.js rename to module/web/src/router/index.js diff --git a/src/style.css b/module/web/src/style.css similarity index 100% rename from src/style.css rename to module/web/src/style.css diff --git a/src/utils/index.js b/module/web/src/utils/index.js similarity index 100% rename from src/utils/index.js rename to module/web/src/utils/index.js diff --git a/src/views/index.vue b/module/web/src/views/index.vue similarity index 100% rename from src/views/index.vue rename to module/web/src/views/index.vue diff --git a/src/views/login.vue b/module/web/src/views/login.vue similarity index 94% rename from src/views/login.vue rename to module/web/src/views/login.vue index fa5148f..c6a3487 100644 --- a/src/views/login.vue +++ b/module/web/src/views/login.vue @@ -31,7 +31,7 @@ function handleLogin() { 登 录
- Linux.Do登录 + Linux.Do登录
Linux.do
@@ -46,7 +46,7 @@ function handleLogin() { diff --git a/vite.config.js b/module/web/vite.config.js similarity index 100% rename from vite.config.js rename to module/web/vite.config.js diff --git a/package.json b/package.json index 952ca0b..dd501fe 100644 --- a/package.json +++ b/package.json @@ -1,30 +1,18 @@ { - "name": "chuanqi-web", - "private": true, - "version": "0.0.0", + "name": "chuanqi-qycq-web", + "version": "1.0.0", + "description": "", + "main": "index.js", "type": "module", "scripts": { - "dev": "vite", - "dev:server": "pnpm --filter chuanqi-server dev", - "start:server": "pnpm --filter chuanqi-server start", - "build": "vite build", - "preview": "vite preview", - "turbo": "turbo run dev" - }, - "dependencies": { - "axios": "^1.12.2", - "vue": "^3.5.21", - "vue-router": "^4.5.1" + "dev": "node scripts/dev.js", + "build": "pnpm -r run build" }, + "keywords": [], + "author": "Kubbo", + "license": "ISC", + "packageManager": "pnpm@10.18.2", "devDependencies": { - "@vitejs/plugin-vue": "^6.0.1", - "turbo": "^2.5.8", - "vite": "^7.1.7" - }, - "pnpm": { - "workspace": [ - "server" - ] - }, - "packageManager": "pnpm@10.18.2" + "concurrently": "^9.2.1" + } } diff --git a/scripts/dev.js b/scripts/dev.js new file mode 100644 index 0000000..1e04773 --- /dev/null +++ b/scripts/dev.js @@ -0,0 +1,6 @@ +import concurrently from 'concurrently'; +const scope = [ + {"name": "WEB", "command": "pnpm --filter ./module/web dev"}, + {"name": "HTTP", "command": "pnpm --filter ./module/server dev"} +] +concurrently(scope, {"prefix": "[{name}]", "killOthers": ["failure", "success"], prefixColors: 'auto'}) diff --git a/turbo.json b/turbo.json deleted file mode 100644 index 174a10a..0000000 --- a/turbo.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://turbo.build/schema.json", - "tasks": { - "dev": { - "cache": false, - "persistent": true - } - } -}