diff --git a/src/App.vue b/src/App.vue index 9b05dc4..030e00e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,160 +1,15 @@ - + \ No newline at end of file diff --git a/src/api/stock.js b/src/api/stock.js new file mode 100644 index 0000000..f5e4a2e --- /dev/null +++ b/src/api/stock.js @@ -0,0 +1,11 @@ +import axios from 'axios' + +const request = axios.create({ + baseURL: 'http://localhost:18080/api/v1', // 指向你的 Go 后端 + timeout: 10000 +}) + +// 获取涨停回落分析数据 +export const getAnalyzeData = (params) => { + return request.get('/stock/analyze', { params }) +} \ No newline at end of file diff --git a/src/assets/hero.png b/src/assets/hero.png deleted file mode 100644 index 02251f4..0000000 Binary files a/src/assets/hero.png and /dev/null differ diff --git a/src/assets/vite.svg b/src/assets/vite.svg deleted file mode 100644 index 5101b67..0000000 --- a/src/assets/vite.svg +++ /dev/null @@ -1 +0,0 @@ -Vite diff --git a/src/assets/vue.svg b/src/assets/vue.svg deleted file mode 100644 index 770e9d3..0000000 --- a/src/assets/vue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index f91553d..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - diff --git a/src/main.js b/src/main.js index aba0b15..b124320 100644 --- a/src/main.js +++ b/src/main.js @@ -1,8 +1,17 @@ import { createApp } from 'vue' import App from './App.vue' +import router from './router' import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' +// 引入中文语言包 +import zhCn from 'element-plus/dist/locale/zh-cn.mjs' const app = createApp(App) -app.use(ElementPlus) + +app.use(router) +// 全局配置 Element Plus 使用中文 +app.use(ElementPlus, { + locale: zhCn, +}) + app.mount('#app') \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..04b338e --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,20 @@ +import { createRouter, createWebHistory } from 'vue-router' + +const routes = [ + { + path: '/', + redirect: '/stock/analyze' + }, + { + path: '/stock/analyze', + name: 'StockAnalyze', + component: () => import('../views/stock/Analyze.vue') + } +] + +const router = createRouter({ + history: createWebHistory(), + routes +}) + +export default router \ No newline at end of file diff --git a/src/views/stock/Analyze.vue b/src/views/stock/Analyze.vue new file mode 100644 index 0000000..54af5c2 --- /dev/null +++ b/src/views/stock/Analyze.vue @@ -0,0 +1,156 @@ + + + + + \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index bbcf80c..9410c1a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,15 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import path from 'path' -// https://vite.dev/config/ export default defineConfig({ plugins: [vue()], -}) + resolve: { + alias: { + '@': path.resolve(__dirname, './src') + } + }, + server: { + port: 5173 + } +}) \ No newline at end of file