diff --git a/Dockerfile b/Dockerfile index dbd1071..774d74a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:stable-alpine3.17-slim AS dev +FROM nginx:1.25-alpine3.17-slim AS dev WORKDIR /usr/share/nginx/html COPY etc/www.conf /etc/nginx/conf.d/default.conf diff --git a/README.md b/README.md index d8b4f28..89d8c2a 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ npm install --global yarn ``` 将8081修改为你要开放的端口,你可以通过使用`docker ps`命令查看服务端已有的服务的端口,将该端口设置为与服务端应用都不冲突的端口即可,通常设置的范围是8000-8999 -3. 执行不是 +3. 执行部署 ```bash docker compose up -d --build ``` diff --git a/index.html b/index.html index 62678ff..3214a1a 100644 --- a/index.html +++ b/index.html @@ -3,8 +3,8 @@ - + SOSD 服务外包创新创业实验室 diff --git a/package.json b/package.json index 3b101be..dfde8bf 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,13 @@ "preview": "vite preview" }, "dependencies": { - "vue": "^2.7.0" + "vue": "^2.7.0", + "vue-router": "^3.2.0", + "vuex": "^3.4.0" }, "devDependencies": { "@vitejs/plugin-vue2": "^2.3.1", + "autoprefixer": "^10.4.19", "sass": "^1.72.0", "vite": "^5.2.0" } diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..1b822c5 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 4fcdfcf..37cc780 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,30 +1,19 @@ - - diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index c7eccc2..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - - - diff --git a/src/main.js b/src/main.js index 8eea13b..0399089 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,13 @@ import Vue from 'vue' import './styles/style.scss' import App from './App.vue' +import router from "@/routers"; +import store from "@/stores"; + +Vue.config.productionTip = false; new Vue({ + store, + router, render: (h) => h(App) }).$mount("#app") diff --git a/src/routers/entry.js b/src/routers/entry.js new file mode 100644 index 0000000..dfe87bf --- /dev/null +++ b/src/routers/entry.js @@ -0,0 +1,4 @@ +export default [{ + path: "/", + component: () => import("@/views/index.vue") +}] \ No newline at end of file diff --git a/src/routers/index.js b/src/routers/index.js new file mode 100644 index 0000000..23c123e --- /dev/null +++ b/src/routers/index.js @@ -0,0 +1,21 @@ +import Vue from "vue"; +import VueRouter from "vue-router"; +import entry from "./entry.js" + +Vue.use(VueRouter) + +// 防止重复路由 console报错信息 +const originalPush = VueRouter.prototype.push; +VueRouter.prototype.push = function push(location) { + return originalPush.call(this, location).catch((err) => err); +}; + +const routes = [].concat(entry); + +const router = new VueRouter({ + mode: "history", + base: process.env.BASE_URL, + routes, +}); + +export default router; \ No newline at end of file diff --git a/src/stores/index.js b/src/stores/index.js new file mode 100644 index 0000000..2dd8b29 --- /dev/null +++ b/src/stores/index.js @@ -0,0 +1,15 @@ +import Vue from 'vue' +import Vuex from 'vuex' + +Vue.use(Vuex) + +export default new Vuex.Store({ + state: { + }, + mutations: { + }, + actions: { + }, + modules: { + } +}) \ No newline at end of file diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..917bea3 --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 7b7b5cd..86c24cc 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,24 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue2' +import path, { resolve } from 'path'; +import autoprefixer from 'autoprefixer'; // https://vitejs.dev/config/ export default defineConfig({ + css: { + postcss: { + plugins: [ + autoprefixer(), + ], + }, + }, plugins: [vue()], + resolve: { + alias: { + '@': path.resolve(__dirname, './src'), + }, + }, + define: { + "process.env.BASE_URL": "'/'" + } }) diff --git a/yarn.lock b/yarn.lock index 73aabb5..c16da78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -226,6 +226,18 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +autoprefixer@^10.4.19: + version "10.4.19" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.19.tgz#ad25a856e82ee9d7898c59583c1afeb3fa65f89f" + integrity sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew== + dependencies: + browserslist "^4.23.0" + caniuse-lite "^1.0.30001599" + fraction.js "^4.3.7" + normalize-range "^0.1.2" + picocolors "^1.0.0" + postcss-value-parser "^4.2.0" + binary-extensions@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" @@ -238,6 +250,21 @@ braces@~3.0.2: dependencies: fill-range "^7.0.1" +browserslist@^4.23.0: + version "4.23.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" + integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== + dependencies: + caniuse-lite "^1.0.30001587" + electron-to-chromium "^1.4.668" + node-releases "^2.0.14" + update-browserslist-db "^1.0.13" + +caniuse-lite@^1.0.30001587, caniuse-lite@^1.0.30001599: + version "1.0.30001600" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001600.tgz#93a3ee17a35aa6a9f0c6ef1b2ab49507d1ab9079" + integrity sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ== + "chokidar@>=3.0.0 <4.0.0": version "3.6.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" @@ -258,6 +285,11 @@ csstype@^3.1.0: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== +electron-to-chromium@^1.4.668: + version "1.4.721" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.721.tgz#a9ee55ba7e54d9ecbcc19825116f3752e7d60ef2" + integrity sha512-k1x2r6foI8iJOp+1qTxbbrrWMsOiHkzGBYwYigaq+apO1FSqtn44KTo3Sy69qt7CRr7149zTcsDvH7MUKsOuIQ== + esbuild@^0.20.1: version "0.20.2" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.20.2.tgz#9d6b2386561766ee6b5a55196c6d766d28c87ea1" @@ -287,6 +319,11 @@ esbuild@^0.20.1: "@esbuild/win32-ia32" "0.20.2" "@esbuild/win32-x64" "0.20.2" +escalade@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" + integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -294,6 +331,11 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +fraction.js@^4.3.7: + version "4.3.7" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" + integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== + fsevents@~2.3.2, fsevents@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" @@ -340,11 +382,21 @@ nanoid@^3.3.7: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== +node-releases@^2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" + integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -355,6 +407,11 @@ picomatch@^2.0.4, picomatch@^2.2.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + postcss@^8.4.14, postcss@^8.4.36: version "8.4.38" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.38.tgz#b387d533baf2054288e337066d81c6bee9db9e0e" @@ -426,6 +483,14 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + vite@^5.2.0: version "5.2.6" resolved "https://registry.yarnpkg.com/vite/-/vite-5.2.6.tgz#fc2ce309e0b4871e938cb0aca3b96c422c01f222" @@ -437,6 +502,11 @@ vite@^5.2.0: optionalDependencies: fsevents "~2.3.3" +vue-router@^3.2.0: + version "3.6.5" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.6.5.tgz#95847d52b9a7e3f1361cb605c8e6441f202afad8" + integrity sha512-VYXZQLtjuvKxxcshuRAwjHnciqZVoXAjTjcqBTz4rKc8qih9g9pI3hbDjmqXaHdgL3v8pV6P8Z335XvHzESxLQ== + vue@^2.7.0: version "2.7.16" resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.16.tgz#98c60de9def99c0e3da8dae59b304ead43b967c9" @@ -444,3 +514,8 @@ vue@^2.7.0: dependencies: "@vue/compiler-sfc" "2.7.16" csstype "^3.1.0" + +vuex@^3.4.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71" + integrity sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==