This commit is contained in:
2025-12-15 17:55:32 +08:00
commit 28ab17324d
170 changed files with 18373 additions and 0 deletions

File diff suppressed because one or more lines are too long

13
frontend/user/dist/index.html vendored Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>QuyUn</title>
<script type="module" crossorigin src="./assets/index-wt7BFVvy.js"></script>
</head>
<body>
<div id="app"></div>
</body>
</html>

13
frontend/user/index.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>QuyUn</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

1614
frontend/user/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
{
"name": "@quyun/user",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.7.9",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@types/node": "^22.10.2",
"@vitejs/plugin-vue": "^5.2.1",
"typescript": "^5.7.2",
"vite": "^6.0.3"
}
}

View File

@@ -0,0 +1,4 @@
<template>
<router-view />
</template>

8
frontend/user/src/api.ts Normal file
View File

@@ -0,0 +1,8 @@
import axios from 'axios'
import { getApiBaseURL } from './tenant'
export const api = axios.create({
baseURL: getApiBaseURL(),
withCredentials: true,
})

2
frontend/user/src/env.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
/// <reference types="vite/client" />

View File

@@ -0,0 +1,6 @@
import { createApp } from 'vue'
import { router } from './router'
import App from './App.vue'
createApp(App).use(router).mount('#app')

View File

@@ -0,0 +1,12 @@
import { createRouter, createWebHistory } from 'vue-router'
import { getUserRouterBase } from './tenant'
import HomePage from './views/HomePage.vue'
export const router = createRouter({
history: createWebHistory(getUserRouterBase()),
routes: [
{ path: '/', component: HomePage },
{ path: '/:pathMatch(.*)*', redirect: '/' },
],
})

View File

@@ -0,0 +1,16 @@
export function getTenantCodeFromPath(pathname = window.location.pathname): string {
const parts = pathname.split('/').filter(Boolean)
if (parts.length < 2 || parts[0] !== 't') return ''
return decodeURIComponent(parts[1] || '').toLowerCase()
}
export function getUserRouterBase(pathname = window.location.pathname): string {
const tenantCode = getTenantCodeFromPath(pathname)
return `/t/${tenantCode}/`
}
export function getApiBaseURL(pathname = window.location.pathname): string {
const tenantCode = getTenantCodeFromPath(pathname)
return `/t/${tenantCode}/v1`
}

View File

@@ -0,0 +1,20 @@
<template>
<main style="padding: 16px">
<h1 style="font-size: 20px; font-weight: 600">QuyUn</h1>
<p style="margin-top: 8px; color: #666">
Router base: <code>{{ base }}</code>
</p>
<p style="margin-top: 4px; color: #666">
API baseURL: <code>{{ apiBase }}</code>
</p>
</main>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { getApiBaseURL, getUserRouterBase } from '../tenant'
const base = computed(() => getUserRouterBase())
const apiBase = computed(() => getApiBaseURL())
</script>

View File

@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ES2022",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"strict": true,
"types": ["vite/client"]
},
"include": ["src"]
}

View File

@@ -0,0 +1,11 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
base: './',
server: {
port: 5174,
},
})