From 401dd82701025919a430aa8cb80485e436139d77 Mon Sep 17 00:00:00 2001 From: fan9704 Date: Tue, 18 Jul 2023 18:56:32 +0800 Subject: [PATCH] Update Project Base Route --- .github/workflows/main.yml | 16 +++++++++++----- package.json | 3 ++- src/router/index.js | 8 +++++++- vite.config.js | 1 + 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46a3fc6..6d0c67a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,20 +10,26 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 #Copy Code to Runner + - uses: actions/checkout@v3 #Copy Code to Runner + - name: Set timezone to Asia/Taipei + uses: szenius/set-timezone@v1.0 + with: + timezoneLinux: "Asia/Taipei" + timezoneMacos: "Asia/Taipei" + - name: Set up Node.js #Setup NodeJs Version - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '16.15.1' + node-version: 18 - name: install dependencies run: yarn install - name: try to build the project - run: yarn build + run: yarn build:production - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist \ No newline at end of file + publish_dir: ./dist_netlify \ No newline at end of file diff --git a/package.json b/package.json index a9b205f..cd7594b 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,12 @@ "version": "0.0.0", "private": true, "main": "main.js", - "description": "Pet Monotoring System Frontend", + "description": "Pet Monitoring System Frontend", "author": "FKT", "scripts": { "serve": "vite preview", "build": "vite build", + "build:production": "vite build && mv dist dist_netlify/PetMonitoringSystem-Frontend", "dev": "vite", "preview": "vite preview" }, diff --git a/src/router/index.js b/src/router/index.js index a728045..9c2549c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,6 +5,7 @@ import HelloWorld from "../components/HelloWorld.vue"; import LoginView from "../views/Login.vue"; import PetListView from "../views/PetList.vue"; import MachineManagement from "../views/MachineManagement.vue"; +import ChatLayout from "../components/chatComponents/chatLayout.vue"; const routes = [ { @@ -37,11 +38,16 @@ const routes = [ path: "/graph", name: "stompChat", component: StompChat, + }, + { + path:"/chat", + name:"chatLayout", + component:ChatLayout } ]; const router = createRouter({ - history: createWebHistory(), + history: createWebHistory('/PetMonitoringSystem-Frontend/'), routes, }); diff --git a/vite.config.js b/vite.config.js index e6ab357..898c3bc 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,6 +13,7 @@ export default ({ mode }) => { // base: process.env.NODE_ENV === 'production' // ? '/PetMonitoringSystem-Frontend/' // : '/', + base: '/PetMonitoringSystem-Frontend/', build:{ chunkSizeWarningLimit:1500, },