fix: 修复三端路由引用并统一共享 Logo 静态资源

修正 admin/agent/player 路由与 agent App.vue 的 import 路径,三端 Vite 共用 packages/shared/public 下的 logo 与 favicon。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 15:01:55 +08:00
parent 4c92157299
commit 000bd8c956
18 changed files with 65 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8" /><title>TheBet365 Agent</title></head>
<head><meta charset="UTF-8" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><title>TheBet365 Agent</title></head>
<body><div id="app"></div><script type="module" src="/src/main.ts"></script></body>
</html>

View File

@@ -1 +1,4 @@
<script setup lang="ts"><template><router-view /></template></script>
<script setup lang="ts">
import { RouterView } from 'vue-router';
</script>
<template><RouterView /></template>

View File

@@ -11,7 +11,10 @@ function logout() {
<template>
<el-container style="min-height: 100vh">
<el-aside width="180px" style="background: #1a2332">
<div style="padding: 16px; color: #00a826; font-weight: 700">代理后台</div>
<div style="padding: 16px">
<img src="/logo.svg" alt="TheBet365" style="height: 24px; width: auto; display: block" />
<div style="margin-top: 8px; font-size: 12px; color: #888">代理后台</div>
</div>
<el-menu background-color="#1a2332" text-color="#ccc" active-text-color="#00a826">
<el-menu-item index="/"><RouterLink to="/" style="color: inherit">概览</RouterLink></el-menu-item>
<el-menu-item index="/players"><RouterLink to="/players" style="color: inherit">直属玩家</RouterLink></el-menu-item>

View File

@@ -3,15 +3,15 @@ import { createRouter, createWebHistory } from 'vue-router';
export default createRouter({
history: createWebHistory(),
routes: [
{ path: '/login', component: () => import('./views/Login.vue') },
{ path: '/login', component: () => import('../views/Login.vue') },
{
path: '/',
component: () => import('./layouts/AgentLayout.vue'),
component: () => import('../layouts/AgentLayout.vue'),
children: [
{ path: '', component: () => import('./views/Dashboard.vue') },
{ path: 'players', component: () => import('./views/Players.vue') },
{ path: 'agents', component: () => import('./views/SubAgents.vue') },
{ path: 'bets', component: () => import('./views/Bets.vue') },
{ path: '', component: () => import('../views/Dashboard.vue') },
{ path: 'players', component: () => import('../views/Players.vue') },
{ path: 'agents', component: () => import('../views/SubAgents.vue') },
{ path: 'bets', component: () => import('../views/Bets.vue') },
],
},
],

View File

@@ -21,8 +21,11 @@ async function login() {
<template>
<div style="min-height: 100vh; display: flex; align-items: center; justify-content: center">
<el-card style="width: 360px">
<h2 style="text-align: center">代理后台登录</h2>
<el-form @submit.prevent="login" style="margin-top: 20px">
<div style="text-align: center; margin-bottom: 20px">
<img src="/logo.svg" alt="TheBet365" style="height: 32px; width: auto" />
<h2 style="margin-top: 12px; font-size: 16px; font-weight: 500">代理后台登录</h2>
</div>
<el-form @submit.prevent="login" style="margin-top: 0">
<el-input v-model="form.username" placeholder="用户名" style="margin-bottom: 12px" />
<el-input v-model="form.password" type="password" placeholder="密码" style="margin-bottom: 12px" />
<el-button type="primary" native-type="submit" style="width: 100%">登录</el-button>

View File

@@ -1,8 +1,10 @@
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
export default defineConfig({
plugins: [vue()],
publicDir: resolve(__dirname, '../../packages/shared/public'),
server: {
port: 5175,
proxy: { '/api': { target: 'http://localhost:3000', changeOrigin: true } },