From 220677785d822297c7225edb79b745a803c3f19a Mon Sep 17 00:00:00 2001 From: wzclm <2855471171@qq.com> Date: Sun, 16 Mar 2025 00:45:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 2 +- src/api/videos.js | 9 +++++++++ src/router/index.js | 13 +++++++++++-- vite.config.js | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 src/api/videos.js diff --git a/.env.production b/.env.production index f5561ec..ae6a6f9 100644 --- a/.env.production +++ b/.env.production @@ -2,7 +2,7 @@ VITE_NODE_ENV=production # API 基础路径 - 实际项目中替换为真实的后端接口地址 -VITE_API_BASE_URL=https://api.your-domain.com +VITE_API_BASE_URL=http://127.0.0.1:3000 # 项目基础路径 VITE_BASE_URL=/ diff --git a/src/api/videos.js b/src/api/videos.js new file mode 100644 index 0000000..59c2976 --- /dev/null +++ b/src/api/videos.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +/** + * 获取视频列表 + * @returns {Promise} 返回视频列表数据 + */ +export function getVideoList() { + return request.get('/api/videos/list') +} \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index f0dc892..d58cca2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,4 +1,4 @@ -import { createRouter, createWebHistory } from 'vue-router' +import { createRouter, createWebHashHistory } from 'vue-router' import AdminLayout from '../layout/AdminLayout.vue' import { useUserStore } from '../stores/user' @@ -24,7 +24,7 @@ Promise.all([ ]) const router = createRouter({ - history: createWebHistory(), + history: createWebHashHistory(), routes: [ { path: '/', @@ -269,6 +269,15 @@ const router = createRouter({ title: '无人机管理', keepAlive: true } + }, + { + path: 'videos', + name: 'VideoList', + component: () => import(/* webpackChunkName: "aipatrol" */ '../views/AIPatrol/videos/index.vue'), + meta: { + title: '视频列表', + keepAlive: true + } } ] }, diff --git a/vite.config.js b/vite.config.js index 3877f37..599db79 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,6 +4,7 @@ import path from 'path' // https://vitejs.dev/config/ export default defineConfig({ + base: './', plugins: [vue()], resolve: { alias: {