Merge branch 'master' of ssh://47.101.48.251/data/git/xxfcyds2026/xxfcyds2026-frontend

# Conflicts:
#	src/styles/login-page-overrides.css
#	src/views/ApplyFormView.vue
#	src/views/LoginView.vue
master
weizong song 5 months ago
commit b7e76c57c3

@ -1,6 +1,10 @@
import axios from 'axios'
import { adminHttp } from './http'
import type {
AdminApplicationDetail,
AdminApplicationExportMeta,
AdminApplicationExportMode,
AdminApplicationExportParams,
AdminApplicationListParams,
AdminApplicationRow,
Paginated,
@ -53,12 +57,148 @@ export async function downloadAdminApplicationFile(
`/competitions/${competitionId}/applications/${applicationId}/files/${fileId}/download`,
{ responseType: 'blob' },
)
const blobUrl = URL.createObjectURL(res.data)
triggerBlobDownload(res.data, fallbackName || '附件')
}
function triggerBlobDownload(blob: Blob, filename: string): void {
const blobUrl = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = blobUrl
a.download = fallbackName || '附件'
a.download = filename
document.body.appendChild(a)
a.click()
a.remove()
URL.revokeObjectURL(blobUrl)
}
function parseDownloadFilename(disposition: string | undefined, fallback: string): string {
if (!disposition) return fallback
const utf8Match = /filename\*=UTF-8''([^;]+)/i.exec(disposition)
if (utf8Match?.[1]) {
return decodeURIComponent(utf8Match[1])
}
const plainMatch = /filename="?([^";]+)"?/i.exec(disposition)
if (plainMatch?.[1]) return plainMatch[1]
return fallback
}
async function readExportError(error: unknown): Promise<Error> {
if (axios.isAxiosError(error)) {
const data = error.response?.data
if (data instanceof Blob) {
const text = await data.text()
try {
const payload = JSON.parse(text) as { message?: string; errors?: Record<string, string[]> }
return new Error(
payload.errors?.export?.[0]
|| payload.errors?.application_ids?.[0]
|| payload.errors?.part?.[0]
|| payload.message
|| '导出失败',
)
} catch {
// ignore non-json blob errors
}
}
if (data && typeof data === 'object') {
const payload = data as { message?: string; errors?: Record<string, string[]> }
return new Error(
payload.errors?.export?.[0]
|| payload.errors?.application_ids?.[0]
|| payload.errors?.part?.[0]
|| payload.message
|| '导出失败',
)
}
}
return error instanceof Error ? error : new Error('导出失败')
}
function sleep(ms: number): Promise<void> {
return new Promise((resolve) => {
window.setTimeout(resolve, ms)
})
}
function buildExportQueryParams(
params: AdminApplicationExportParams,
): Record<string, unknown> {
const { mode, application_ids, part, ...filters } = params
const query: Record<string, unknown> = { mode, ...filters }
if (application_ids?.length) {
query.application_ids = application_ids
}
if (part != null) {
query.part = part
}
return query
}
export async function getAdminApplicationExportMeta(
competitionId: number,
params: AdminApplicationExportParams,
): Promise<AdminApplicationExportMeta> {
try {
const { data } = await adminHttp.get<AdminApplicationExportMeta>(
`/competitions/${competitionId}/applications/export/meta`,
{ params: buildExportQueryParams(params) },
)
if (!data || typeof data !== 'object') throw new Error('导出信息无效')
return data
} catch (error) {
throw await readExportError(error)
}
}
export async function downloadAdminApplicationExportPart(
competitionId: number,
params: AdminApplicationExportParams,
part: number,
): Promise<void> {
let res
try {
res = await adminHttp.get<Blob>(`/competitions/${competitionId}/applications/export`, {
params: buildExportQueryParams({ ...params, part }),
responseType: 'blob',
timeout: 0,
})
} catch (error) {
throw await readExportError(error)
}
const fallback = params.mode === 'xlsx'
? '报名信息.xlsx'
: `报名信息导出_第${part}部分.zip`
const filename = parseDownloadFilename(
res.headers['content-disposition'] as string | undefined,
fallback,
)
triggerBlobDownload(res.data, filename)
}
export async function exportAdminApplications(
competitionId: number,
params: AdminApplicationExportParams,
onProgress?: (current: number, total: number) => void,
): Promise<AdminApplicationExportMeta> {
const meta = await getAdminApplicationExportMeta(competitionId, params)
if (params.mode === 'xlsx') {
onProgress?.(1, 1)
await downloadAdminApplicationExportPart(competitionId, params, 1)
return meta
}
for (let part = 1; part <= meta.part_count; part += 1) {
onProgress?.(part, meta.part_count)
await downloadAdminApplicationExportPart(competitionId, params, part)
if (part < meta.part_count) {
await sleep(500)
}
}
return meta
}
export type { AdminApplicationExportMode }

@ -1,5 +1,5 @@
import axios from 'axios'
import type { AdminLoginBody, AdminLoginResult } from './types'
import type { AdminChangePasswordBody, AdminLoginBody, AdminLoginResult } from './types'
import { adminHttp } from './http'
/** POST /auth/login — 与 `routes/api.php` 中 `v1/admin` 分组一致 */
@ -41,3 +41,23 @@ function unwrapLogin(raw: unknown): AdminLoginResult {
}
throw new Error('登录响应无效')
}
/** PUT /auth/password */
export async function changeAdminPassword(body: AdminChangePasswordBody): Promise<void> {
try {
await adminHttp.put('/auth/password', body)
} catch (e) {
if (axios.isAxiosError(e)) {
const raw = e.response?.data
const d = raw && typeof raw === 'object' ? (raw as Record<string, unknown>) : {}
const message =
(typeof d.message === 'string' ? d.message : '') ||
(d.errors && typeof d.errors === 'object'
? Object.values(d.errors as Record<string, string[]>).flat().join('\n')
: '') ||
e.message
throw new Error(message || '修改密码失败')
}
throw e
}
}

@ -101,10 +101,28 @@ export interface AdminApplicationListParams {
status?: string
track?: string
keyword?: string
signup_channel_id?: number
}
export type AdminApplicationExportMode = 'xlsx' | 'selected' | 'all'
export interface AdminApplicationExportParams extends AdminApplicationListParams {
mode: AdminApplicationExportMode
application_ids?: number[]
part?: number
}
export interface AdminApplicationExportMeta {
total: number
part_size: number
part_count: number
mode: AdminApplicationExportMode
includes_attachments: boolean
}
export interface AdminApplicationRow {
id: number
project_code: string
status: string
project_name: string
player_name: string
@ -113,6 +131,8 @@ export interface AdminApplicationRow {
entry_group: string
track_code: string
track_title: string
signup_channel: { id: number; channel_code: string; channel_name: string } | null
signup_channel_code: string | null
submitted_at: string | null
updated_at: string | null
files_count: number
@ -355,3 +375,9 @@ export interface AdminLoginResult {
token: string
user?: { id: number; name?: string; username?: string }
}
export interface AdminChangePasswordBody {
current_password: string
password: string
password_confirmation: string
}

@ -19,6 +19,9 @@ export const PARTICIPANT_COMPETITION_SLUG_KEY = 'cxxfds_participant_competition_
/** 管理端 Bearer Token(与选手端分离) */
export const ADMIN_TOKEN_KEY = 'cxxfds_admin_token' as const
/** 管理端登录用户摘要(username / name,用于顶栏展示) */
export const ADMIN_USER_KEY = 'cxxfds_admin_user' as const
/** 当前选中赛事(顶栏切换器),仅存 id */
export const ADMIN_COMPETITION_ID_KEY = 'cxxfds_admin_competition_id' as const
@ -55,6 +58,33 @@ export function pathnameForAdminLogin(): string {
return `${prefix}/admin/login`
}
/**
* 本地开发(Vite base=/)时,将生产构建的 pathname(/admin/admin/...)折叠为 /admin/...,
* 避免登录后 redirect 落到无匹配路由的地址。
*/
export function collapseDevAdminPath(path: string): string {
const baseUrl = import.meta.env.BASE_URL || '/'
if (baseUrl !== '/') return path
if (!path.startsWith('/admin/admin')) return path
const collapsed = path.replace(/^\/admin\/admin(?=\/|$)/, '/admin')
return collapsed || '/admin'
}
/** 登录后 redirect 参数规整(去掉生产 base 前缀,并折叠 dev 下的 /admin/admin) */
export function normalizeAdminRedirectPath(path: string): string {
const trimmed = path.trim()
if (!trimmed) return ''
const baseUrl = import.meta.env.BASE_URL || '/'
const basePrefix = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl
if (basePrefix && basePrefix !== '/' && trimmed.startsWith(`${basePrefix}/admin`)) {
return collapseDevAdminPath(trimmed.slice(basePrefix.length) || '/admin')
}
return collapseDevAdminPath(trimmed)
}
/** 后端 API 根地址(无尾部斜杠)。本地开发/预览默认空字符串,走 Vite 代理的 `/api`,避免跨域。 */
export function getApiBase(): string {
const fromEnv = import.meta.env.VITE_API_BASE as string | undefined

@ -0,0 +1,16 @@
export interface ConsultPhone {
display: string
tel: string
}
/** 选手端登录页 / 报名页展示的参赛咨询电话 */
export const entryConsultPhones: ConsultPhone[] = [
{ display: '0512-66969167', tel: '051266969167' },
{ display: '0512-66969172', tel: '051266969172' },
]
/** 选手端登录页 / 报名页展示的技术咨询电话 */
export const techConsultPhone: ConsultPhone = {
display: '18626298655',
tel: '18626298655',
}

@ -1,9 +1,10 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { onMounted, reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import { storeToRefs } from 'pinia'
import AdminMenuTree from '../components/admin/AdminMenuTree.vue'
import { changeAdminPassword } from '../api/admin/auth'
import { listCompetitions } from '../api/admin/competitions'
import { useAdminAuthStore } from '../stores/adminAuth'
import { useAdminCompetitionStore } from '../stores/adminCompetition'
@ -16,8 +17,38 @@ const competitionStore = useAdminCompetitionStore()
const { menus } = storeToRefs(menuStore)
const { competitions, selectedCompetitionId } = storeToRefs(competitionStore)
const { displayName } = storeToRefs(adminAuth)
const sidebarCollapsed = ref(false)
const passwordDialogVisible = ref(false)
const passwordSubmitting = ref(false)
const passwordFormRef = ref<FormInstance>()
const passwordForm = reactive({
current_password: '',
password: '',
password_confirmation: '',
})
const passwordRules: FormRules = {
current_password: [{ required: true, message: '请输入当前密码', trigger: 'blur' }],
password: [
{ required: true, message: '请输入新密码', trigger: 'blur' },
{ min: 6, max: 255, message: '新密码长度为 6–255 个字符', trigger: 'blur' },
],
password_confirmation: [
{ required: true, message: '请再次输入新密码', trigger: 'blur' },
{
validator: (_rule, value, callback) => {
if (value !== passwordForm.password) {
callback(new Error('两次输入的新密码不一致'))
return
}
callback()
},
trigger: 'blur',
},
],
}
async function refreshSwitcher() {
try {
@ -36,11 +67,55 @@ function onSelectCompetition(id: number) {
competitionStore.selectCompetition(id)
}
function resetPasswordForm() {
passwordForm.current_password = ''
passwordForm.password = ''
passwordForm.password_confirmation = ''
passwordFormRef.value?.clearValidate()
}
function openPasswordDialog() {
resetPasswordForm()
passwordDialogVisible.value = true
}
function logout() {
adminAuth.logout(router)
void router.replace('/admin/login')
}
function onUserCommand(command: string | number | object) {
if (command === 'password') {
openPasswordDialog()
return
}
if (command === 'logout') {
logout()
}
}
async function submitPasswordChange() {
const form = passwordFormRef.value
if (!form) return
const valid = await form.validate().catch(() => false)
if (!valid) return
passwordSubmitting.value = true
try {
await changeAdminPassword({
current_password: passwordForm.current_password,
password: passwordForm.password,
password_confirmation: passwordForm.password_confirmation,
})
passwordDialogVisible.value = false
ElMessage.success('密码已更新')
} catch (e) {
ElMessage.error(e instanceof Error ? e.message : '修改密码失败')
} finally {
passwordSubmitting.value = false
}
}
onMounted(() => {
void refreshSwitcher()
})
@ -85,7 +160,18 @@ onMounted(() => {
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button size="small" @click="logout">退出</el-button>
<el-dropdown trigger="click" placement="bottom-end" @command="onUserCommand">
<button type="button" class="admin-user-trigger" aria-label="账号菜单">
<span class="admin-user-name">{{ displayName }}</span>
<span class="admin-user-caret" aria-hidden="true">▾</span>
</button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="password">修改密码</el-dropdown-item>
<el-dropdown-item divided command="logout">退出</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</el-header>
@ -104,6 +190,53 @@ onMounted(() => {
<router-view />
</el-main>
</el-container>
<el-dialog
v-model="passwordDialogVisible"
title="修改密码"
width="min(420px, 92vw)"
destroy-on-close
@closed="resetPasswordForm"
>
<el-form
ref="passwordFormRef"
:model="passwordForm"
:rules="passwordRules"
label-position="top"
@submit.prevent="submitPasswordChange"
>
<el-form-item label="当前密码" prop="current_password">
<el-input
v-model="passwordForm.current_password"
type="password"
show-password
autocomplete="current-password"
/>
</el-form-item>
<el-form-item label="新密码" prop="password">
<el-input
v-model="passwordForm.password"
type="password"
show-password
autocomplete="new-password"
/>
</el-form-item>
<el-form-item label="确认新密码" prop="password_confirmation">
<el-input
v-model="passwordForm.password_confirmation"
type="password"
show-password
autocomplete="new-password"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="passwordDialogVisible = false">取消</el-button>
<el-button type="primary" :loading="passwordSubmitting" @click="submitPasswordChange">
保存
</el-button>
</template>
</el-dialog>
</el-container>
</template>
@ -143,6 +276,38 @@ onMounted(() => {
color: var(--el-text-color-secondary);
}
.admin-user-trigger {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 5px 12px;
border: 1px solid var(--el-border-color);
border-radius: 4px;
background: var(--el-bg-color);
color: var(--el-text-color-primary);
font-size: 13px;
line-height: 1.4;
cursor: pointer;
transition: border-color 0.2s ease, color 0.2s ease;
}
.admin-user-trigger:hover {
border-color: var(--el-color-primary);
color: var(--el-color-primary);
}
.admin-user-name {
max-width: 160px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.admin-user-caret {
font-size: 11px;
color: var(--el-text-color-secondary);
}
.admin-body {
flex: 1;
min-height: 0;

@ -100,6 +100,21 @@ const router = createRouter({
return s ? { name: 'participant-apply', params: { slug: s } } : { path: '/c' }
},
},
{
path: '/admin/admin/login',
redirect: { name: 'admin-login' },
},
{
path: '/admin/admin',
redirect: { name: 'admin-dashboard' },
},
{
path: '/admin/admin/:rest(.*)',
redirect: (to) => {
const rest = String(to.params.rest ?? '').replace(/^\//, '')
return rest ? `/admin/${rest}` : '/admin'
},
},
{
path: '/admin/login',
name: 'admin-login',
@ -159,7 +174,7 @@ router.beforeEach(async (to) => {
if (to.path.startsWith('/admin')) {
const adminAuth = useAdminAuthStore()
if (to.name === 'admin-login' || to.path === '/admin/login') {
if (to.name === 'admin-login' || to.path === '/admin/login' || to.path === '/admin/admin/login') {
if (adminAuth.isAuthenticated) {
if (!adminDynamicRoutesRegistered()) {
await registerAdminDynamicRoutes(router)

@ -1,14 +1,43 @@
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { ADMIN_TOKEN_KEY } from '../config/api'
import { ADMIN_TOKEN_KEY, ADMIN_USER_KEY } from '../config/api'
import type { Router } from 'vue-router'
import { teardownAdminDynamicRoutes } from '../router/admin/registerDynamicRoutes'
export interface AdminSessionUser {
id: number
username?: string
name?: string
}
function readStoredUser(): AdminSessionUser | null {
try {
const raw = localStorage.getItem(ADMIN_USER_KEY)
if (!raw) return null
const parsed = JSON.parse(raw) as AdminSessionUser
if (parsed && typeof parsed.id === 'number') return parsed
} catch {
/* ignore */
}
return null
}
export const useAdminAuthStore = defineStore('adminAuth', () => {
const token = ref(localStorage.getItem(ADMIN_TOKEN_KEY) ?? '')
const user = ref<AdminSessionUser | null>(readStoredUser())
const isAuthenticated = computed(() => Boolean(token.value.trim()))
const displayName = computed(() => {
const u = user.value
if (!u) return '管理员'
const username = u.username?.trim()
if (username) return username
const name = u.name?.trim()
if (name) return name
return '管理员'
})
function setToken(next: string) {
token.value = next
if (next) {
@ -18,10 +47,34 @@ export const useAdminAuthStore = defineStore('adminAuth', () => {
}
}
function setUser(next: AdminSessionUser | null) {
user.value = next
if (next) {
localStorage.setItem(ADMIN_USER_KEY, JSON.stringify(next))
} else {
localStorage.removeItem(ADMIN_USER_KEY)
}
}
function setSession(nextToken: string, sessionUser?: AdminSessionUser | null) {
setToken(nextToken)
setUser(sessionUser ?? null)
}
function logout(router: Router) {
setToken('')
setUser(null)
teardownAdminDynamicRoutes(router)
}
return { token, isAuthenticated, setToken, logout }
return {
token,
user,
isAuthenticated,
displayName,
setToken,
setUser,
setSession,
logout,
}
})

@ -91,6 +91,16 @@ body.login-page-wls .login-page-wls__contact {
line-height: 1.35;
}
body.login-page-wls .login-page-wls__contact-entry {
display: flex;
flex-wrap: wrap;
align-items: center;
}
body.login-page-wls .login-page-wls__contact-label {
color: inherit;
}
body.login-page-wls .login-page-wls__contact a {
color: inherit;
text-decoration: none;

@ -22,6 +22,7 @@ import {
participantApplyPageTitle,
type BrandingForm,
} from '../utils/competitionBranding'
import { entryConsultPhones, techConsultPhone } from '../config/participantContact'
import {
CONTEST_DEFAULT_FILE_EXTENSIONS,
normalizeSignupSchema,
@ -44,6 +45,7 @@ interface FileItem {
size?: number
url?: string
previewUrl?: string
localBlobUrl?: string
}
interface PublicTrackRow {
@ -121,9 +123,24 @@ function authHeaders(isJson: boolean): HeadersInit {
const t = localStorage.getItem(TOKEN_KEY) || ''
const h: Record<string, string> = { Authorization: `Bearer ${t}`, Accept: 'application/json' }
if (isJson) h['Content-Type'] = 'application/json'
const s = slug.value
if (s) h['X-Competition-Slug'] = s
return h
}
/** 串行发起选手端 API 请求,避免与附件预览等并发占满同域连接导致保存/删除 pending */
let participantApiChain: Promise<unknown> = Promise.resolve()
async function participantApiFetch(input: string, init?: RequestInit): Promise<Response> {
const run = () => fetch(input, init)
const task = participantApiChain.then(run, run)
participantApiChain = task.then(
() => undefined,
() => undefined,
)
return task
}
function goLogin() {
localStorage.removeItem(TOKEN_KEY)
const s = slug.value
@ -316,6 +333,8 @@ watch(
const planFileItems = ref<FileItem[]>([])
const supportingFileItems = ref<FileItem[]>([])
const deletingFileIds = ref<string[]>([])
const savingDraft = ref(false)
const planFileSavedInfo = ref('')
const supportingFilesSavedInfo = ref('')
@ -423,12 +442,6 @@ function fileItemDisplayName(item: FileItem) {
return item.file ? item.file.name : item.original_name || ''
}
/** 预览/下载链上建议保存名(与展示名一致);同源时部分浏览器会采用 */
function fileItemSuggestedDownloadName(item: FileItem): string | undefined {
const n = fileItemDisplayName(item).trim()
return n || undefined
}
function formatSubmittedAt(value: string): string {
if (!value) return ''
const d = new Date(value)
@ -759,7 +772,9 @@ function buildApiPayload(): Record<string, unknown> {
o[f.key] = formModel[f.key] ?? ''
}
if (schemaFields.value.some((f) => f.key === 'commitment_accepted')) {
o.promise_signature = formModel.promise_signature ?? ''
if (formModel.commitment_accepted === '1') {
o.promise_signature = formModel.promise_signature ?? ''
}
}
return o
}
@ -874,7 +889,7 @@ async function uploadNewFiles(target: 'plan' | 'supporting') {
const fd = new FormData()
fd.append('kind', target === 'plan' ? 'plan' : 'supporting')
fd.append('file', item.file)
const r = await fetch(`${apiBase()}/api/applications/current/files${competitionQuery()}`, {
const r = await participantApiFetch(`${apiBase()}/api/applications/current/files${competitionQuery()}`, {
method: 'POST',
headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' },
body: fd,
@ -904,35 +919,92 @@ async function uploadNewFiles(target: 'plan' | 'supporting') {
else validateSupportingFiles()
}
function revokeFileBlobUrl(item: FileItem) {
if (item.localBlobUrl && item.localBlobUrl.startsWith('blob:')) {
URL.revokeObjectURL(item.localBlobUrl)
delete item.localBlobUrl
}
if (item.previewUrl && String(item.previewUrl).startsWith('blob:')) {
URL.revokeObjectURL(item.previewUrl as string)
}
}
async function openFilePreview(item: FileItem) {
if (item.localBlobUrl) {
window.open(item.localBlobUrl, '_blank', 'noopener,noreferrer')
return
}
if (item.file && item.previewUrl?.startsWith('blob:')) {
window.open(item.previewUrl, '_blank', 'noopener,noreferrer')
return
}
const url = normalizePublicAssetUrl(item.previewUrl || item.url)
if (!url) return
if (!item.fromServer) {
window.open(url, '_blank', 'noopener,noreferrer')
return
}
try {
const r = await fetch(url, { credentials: 'omit' })
if (!r.ok) throw new Error('fetch failed')
const blob = await r.blob()
const blobUrl = URL.createObjectURL(blob)
item.localBlobUrl = blobUrl
window.open(blobUrl, '_blank', 'noopener,noreferrer')
} catch {
window.open(url, '_blank', 'noopener,noreferrer')
}
}
async function removeFile(id: string | number, target: 'plan' | 'supporting') {
const key = String(id)
if (deletingFileIds.value.includes(key)) return
let items = target === 'plan' ? [...planFileItems.value] : [...supportingFileItems.value]
const item = items.find((e) => String(e.id) === String(id))
const item = items.find((e) => String(e.id) === key)
if (!item) return
if (item.fromServer && typeof item.id === 'number') {
const serverFileId = item.fromServer ? Number(item.id) : NaN
if (item.fromServer && Number.isFinite(serverFileId) && serverFileId > 0) {
const token = localStorage.getItem(TOKEN_KEY)
if (!token) {
goLogin()
return
}
const r = await fetch(
`${apiBase()}/api/applications/current/files/${item.id}${competitionQuery()}`,
{
method: 'DELETE',
headers: authHeaders(false),
},
)
if (r.status === 401) {
goLogin()
return
}
if (!r.ok) {
showNotice('删除失败', '提示', 'warning')
deletingFileIds.value = [...deletingFileIds.value, key]
try {
const controller = new AbortController()
const timeoutId = window.setTimeout(() => controller.abort(), 15000)
const r = await participantApiFetch(
`${apiBase()}/api/applications/current/files/${serverFileId}/delete${competitionQuery()}`,
{
method: 'POST',
headers: authHeaders(false),
signal: controller.signal,
},
)
window.clearTimeout(timeoutId)
if (r.status === 401) {
goLogin()
return
}
if (r.status !== 404 && !r.ok) {
showNotice('删除失败', '提示', 'warning')
return
}
} catch (err) {
const isTimeout = err instanceof DOMException && err.name === 'AbortError'
showNotice(
isTimeout ? '删除超时,请关闭已打开的预览窗口后重试' : '删除失败',
'提示',
'warning',
)
return
} finally {
deletingFileIds.value = deletingFileIds.value.filter((fileId) => fileId !== key)
}
}
if (item.previewUrl && String(item.previewUrl).startsWith('blob:')) {
URL.revokeObjectURL(item.previewUrl as string)
}
revokeFileBlobUrl(item)
items = items.filter((e) => String(e.id) !== String(id))
if (target === 'plan') planFileItems.value = items
else supportingFileItems.value = items
@ -1157,42 +1229,65 @@ function applyServerPayload(d: {
async function loadApplicationFromServer() {
const token = localStorage.getItem(TOKEN_KEY)
if (!token) return false
const r = await fetch(`${apiBase()}/api/applications/current${competitionQuery()}`, {
headers: authHeaders(false),
})
if (r.status === 401) {
localStorage.removeItem(TOKEN_KEY)
goLogin()
const controller = new AbortController()
const timeoutId = window.setTimeout(() => controller.abort(), 20000)
try {
const r = await participantApiFetch(`${apiBase()}/api/applications/current${competitionQuery()}`, {
headers: authHeaders(false),
signal: controller.signal,
})
if (r.status === 401) {
localStorage.removeItem(TOKEN_KEY)
goLogin()
return false
}
if (!r.ok) return false
const d = (await r.json()) as Parameters<typeof applyServerPayload>[0]
applyServerPayload(d)
return true
} catch {
return false
} finally {
window.clearTimeout(timeoutId)
}
if (!r.ok) return false
const d = (await r.json()) as Parameters<typeof applyServerPayload>[0]
applyServerPayload(d)
return true
}
async function saveDraftToServer() {
const r = await fetch(`${apiBase()}/api/applications/current${competitionQuery()}`, {
method: 'PUT',
headers: authHeaders(true),
body: JSON.stringify(buildApiPayload()),
})
if (r.status === 401) {
goLogin()
return false
}
if (!r.ok) {
void r.json().catch(() => ({}))
showNotice('草稿未能保存,请检查网络或稍后重试。', '保存失败', 'warning')
return false
}
if (savingDraft.value) return false
savingDraft.value = true
const controller = new AbortController()
const timeoutId = window.setTimeout(() => controller.abort(), 20000)
try {
const d = (await r.json()) as Parameters<typeof applyServerPayload>[0]
applyServerPayload(d)
} catch {
/* 非 JSON 时保持本地状态 */
const r = await participantApiFetch(`${apiBase()}/api/applications/current/save${competitionQuery()}`, {
method: 'POST',
headers: authHeaders(true),
body: JSON.stringify(buildApiPayload()),
signal: controller.signal,
})
if (r.status === 401) {
goLogin()
return false
}
if (!r.ok) {
void r.json().catch(() => ({}))
showNotice('草稿未能保存,请检查网络或稍后重试。', '保存失败', 'warning')
return false
}
try {
const d = (await r.json()) as Parameters<typeof applyServerPayload>[0]
applyServerPayload(d)
} catch {
/* 非 JSON 时保持本地状态 */
}
return true
} catch (err) {
const isTimeout = err instanceof DOMException && err.name === 'AbortError'
showNotice(isTimeout ? '保存超时,请稍后重试' : '草稿未能保存,请检查网络或稍后重试。', '保存失败', 'warning')
return false
} finally {
window.clearTimeout(timeoutId)
savingDraft.value = false
}
return true
}
/** Laravel ValidationException:errors 为字段 → 字符串数组 */
@ -1242,38 +1337,49 @@ function submitFailureUserMessage(status: number, body: Record<string, unknown>)
}
async function submitApplicationToServer() {
const r = await fetch(`${apiBase()}/api/applications/current/submit${competitionQuery()}`, {
method: 'POST',
headers: authHeaders(true),
body: JSON.stringify(buildApiPayload()),
})
if (r.status === 401) {
goLogin()
return false
}
if (!r.ok) {
let body: Record<string, unknown> = {}
try {
body = (await r.json()) as Record<string, unknown>
} catch {
/* 非 JSON */
const controller = new AbortController()
const timeoutId = window.setTimeout(() => controller.abort(), 30000)
try {
const r = await participantApiFetch(`${apiBase()}/api/applications/current/submit${competitionQuery()}`, {
method: 'POST',
headers: authHeaders(true),
body: JSON.stringify(buildApiPayload()),
signal: controller.signal,
})
if (r.status === 401) {
goLogin()
return false
}
if (!r.ok) {
let body: Record<string, unknown> = {}
try {
body = (await r.json()) as Record<string, unknown>
} catch {
/* 非 JSON */
}
showNotice(submitFailureUserMessage(r.status, body), '提交失败', 'warning')
return false
}
const d = (await r.json()) as Parameters<typeof applyServerPayload>[0] & {
channel_callback?: ChannelCallback | null
success_notice?: { enabled?: unknown; message?: unknown } | null
}
applyServerPayload(d)
const successNotice = d.success_notice
const successNoticeMessage =
successNotice?.enabled === true && typeof successNotice.message === 'string'
? successNotice.message.trim()
: ''
return {
channelCallback: normalizeChannelCallback(d.channel_callback),
successNoticeMessage,
}
showNotice(submitFailureUserMessage(r.status, body), '提交失败', 'warning')
} catch (err) {
const isTimeout = err instanceof DOMException && err.name === 'AbortError'
showNotice(isTimeout ? '提交超时,请稍后重试' : '报名未能提交,请检查网络或稍后重试。', '提交失败', 'warning')
return false
}
const d = (await r.json()) as Parameters<typeof applyServerPayload>[0] & {
channel_callback?: ChannelCallback | null
success_notice?: { enabled?: unknown; message?: unknown } | null
}
applyServerPayload(d)
const successNotice = d.success_notice
const successNoticeMessage =
successNotice?.enabled === true && typeof successNotice.message === 'string'
? successNotice.message.trim()
: ''
return {
channelCallback: normalizeChannelCallback(d.channel_callback),
successNoticeMessage,
} finally {
window.clearTimeout(timeoutId)
}
}
@ -1368,8 +1474,13 @@ onMounted(() => {
</div>
</div>
<div class="apply-contact-panel" aria-label="咨询电话">
<a href="tel:17665307139">参赛咨询:17665307139</a>
<a href="tel:18626298655">技术咨询:18626298655</a>
<span class="apply-contact-label">参赛咨询:</span>
<a
v-for="phone in entryConsultPhones"
:key="phone.tel"
:href="`tel:${phone.tel}`"
>{{ phone.display }}</a>
<a :href="`tel:${techConsultPhone.tel}`">技术咨询:{{ techConsultPhone.display }}</a>
</div>
<form
id="applyForm"
@ -1491,21 +1602,20 @@ onMounted(() => {
}}</span>
</div>
<div class="supporting-file-actions">
<a
<button
type="button"
class="btn btn-sm btn-outline-primary"
:href="item.previewUrl || item.url || '#'"
:download="fileItemSuggestedDownloadName(item)"
target="_blank"
rel="noopener"
>查看/下载</a
@click="openFilePreview(item)"
>
查看/下载
</button>
<button
type="button"
class="btn btn-sm btn-outline-secondary"
:disabled="formDisabled"
class="btn btn-sm btn-outline-danger"
:disabled="formDisabled || deletingFileIds.includes(String(item.id))"
@click="removeFile(item.id, 'plan')"
>
删除
{{ deletingFileIds.includes(String(item.id)) ? '删除中…' : '删除' }}
</button>
</div>
</div>
@ -1557,21 +1667,20 @@ onMounted(() => {
}}</span>
</div>
<div class="supporting-file-actions">
<a
<button
type="button"
class="btn btn-sm btn-outline-primary"
:href="item.previewUrl || item.url || '#'"
:download="fileItemSuggestedDownloadName(item)"
target="_blank"
rel="noopener"
>查看/下载</a
@click="openFilePreview(item)"
>
查看/下载
</button>
<button
type="button"
class="btn btn-sm btn-outline-secondary"
:disabled="formDisabled"
class="btn btn-sm btn-outline-danger"
:disabled="formDisabled || deletingFileIds.includes(String(item.id))"
@click="removeFile(item.id, 'supporting')"
>
删除
{{ deletingFileIds.includes(String(item.id)) ? '删除中…' : '删除' }}
</button>
</div>
</div>
@ -1783,8 +1892,13 @@ onMounted(() => {
</div>
</template>
<div class="col-12 apply-form-actions mt-3 pt-3 border-top d-flex gap-2 flex-wrap">
<button type="button" class="btn btn-outline-primary" :disabled="formDisabled" @click="onSaveClick">
{{ isSubmitted ? '保存修改' : '保存' }}
<button
type="button"
class="btn btn-outline-primary"
:disabled="formDisabled || savingDraft"
@click="onSaveClick"
>
{{ savingDraft ? '保存中…' : isSubmitted ? '保存修改' : '保存' }}
</button>
<button type="button" class="btn btn-success" :disabled="formDisabled" @click="onSubmitClick">
{{ isSubmitted ? '更新报名' : '提交报名' }}
@ -1957,8 +2071,8 @@ onMounted(() => {
.apply-contact-panel {
display: flex;
flex-wrap: wrap;
gap: 0.45rem 1rem;
align-items: center;
gap: 0.45rem 1rem;
margin-bottom: 1rem;
padding: 0.72rem 0.9rem;
border: 1px solid #e4e9ef;
@ -1975,7 +2089,7 @@ onMounted(() => {
}
.apply-contact-panel a:hover {
color: #0d6efd;
color: #052d62;
text-decoration: underline;
}

@ -15,6 +15,7 @@ import {
type BrandingForm,
} from '../utils/competitionBranding'
import { readPublicSourceCodeForAttribution } from '../utils/publicSource'
import { entryConsultPhones, techConsultPhone } from '../config/participantContact'
import '../styles/prototype-styles.css'
import '../styles/login-page-overrides.css'
@ -465,8 +466,14 @@ onUnmounted(() => {
{{ submitting ? '登录中…' : '登录' }}
</button>
<div class="login-page-wls__contact" aria-label="咨询电话">
<a href="tel:17665307139">参赛咨询:17665307139</a>
<a href="tel:18626298655">技术咨询:18626298655</a>
<div class="login-page-wls__contact-entry">
<span class="login-page-wls__contact-label">参赛咨询:</span>
<template v-for="(phone, index) in entryConsultPhones" :key="phone.tel">
<span v-if="index > 0" class="login-page-wls__contact-sep">、</span>
<a :href="`tel:${phone.tel}`">{{ phone.display }}</a>
</template>
</div>
<a :href="`tel:${techConsultPhone.tel}`">技术咨询:{{ techConsultPhone.display }}</a>
</div>
<p v-if="apiHint" :class="apiHintClass" style="margin-top: 0.75rem">{{ apiHint }}</p>
</form>

@ -1,8 +1,9 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useRoute, useRouter, type RouteLocationRaw } from 'vue-router'
import { ElMessage } from 'element-plus'
import { adminLogin } from '../../api/admin/auth'
import { normalizeAdminRedirectPath } from '../../config/api'
import { useAdminAuthStore } from '../../stores/adminAuth'
const route = useRoute()
@ -19,24 +20,13 @@ function loginErrorMessage(e: unknown): string {
return '登录失败'
}
function normalizeAdminRedirectPath(path: string): string {
const baseUrl = import.meta.env.BASE_URL || '/'
const basePrefix = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl
if (basePrefix && basePrefix !== '/' && path.startsWith(`${basePrefix}/admin`)) {
return path.slice(basePrefix.length) || '/admin'
}
return path
}
function resolvePostLoginPath(): string {
function resolvePostLoginTarget(): RouteLocationRaw {
const redir = typeof route.query.redirect === 'string' ? route.query.redirect : ''
const normalized = normalizeAdminRedirectPath(redir)
if (normalized && normalized.startsWith('/admin') && !normalized.includes('/login')) {
return normalized
return { path: normalized, replace: true }
}
return '/admin'
return { name: 'admin-dashboard', replace: true }
}
async function onSubmit() {
@ -50,8 +40,16 @@ async function onSubmit() {
username: username.value.trim(),
password: password.value.trim(),
})
adminAuth.setToken(res.token)
await router.replace(resolvePostLoginPath())
const sessionUser =
res.user && typeof res.user.id === 'number'
? {
id: res.user.id,
username: res.user.username,
name: res.user.name,
}
: null
adminAuth.setSession(res.token, sessionUser)
await router.replace(resolvePostLoginTarget())
ElMessage.success('登录成功')
} catch (e) {
ElMessage.error(loginErrorMessage(e))

@ -22,11 +22,14 @@ import {
} from '../../../api/admin/signupChannels'
import {
downloadAdminApplicationFile,
exportAdminApplications,
getAdminApplication,
listAdminApplications,
type AdminApplicationExportMode,
} from '../../../api/admin/applications'
import type {
AdminApplicationDetail,
AdminApplicationFileRow,
AdminApplicationRow,
CompetitionPayload,
CompetitionSuccessNoticeSettings,
@ -97,7 +100,10 @@ const tracksLoading = ref(false)
const channels = ref<SignupChannelRow[]>([])
const channelsLoading = ref(false)
const applications = ref<AdminApplicationRow[]>([])
const selectedApplications = ref<AdminApplicationRow[]>([])
const applicationsLoading = ref(false)
const applicationsExporting = ref(false)
const applicationsExportProgress = ref('')
const applicationDetailLoading = ref(false)
const applicationDetailVisible = ref(false)
const applicationDetail = ref<AdminApplicationDetail | null>(null)
@ -108,8 +114,9 @@ const applicationPager = ref({
})
const applicationFilters = ref({
keyword: '',
status: '',
status: 'submitted',
track: '',
signup_channel_id: undefined as number | undefined,
})
const trackDialogVisible = ref(false)
@ -280,7 +287,10 @@ watch(tabKey, (t) => {
const cid = competitionId.value
if (!cid) return
if (t === 'channels') void refreshChannels()
if (t === 'applications') void refreshApplications()
if (t === 'applications') {
void refreshChannels()
void refreshApplications()
}
if (t === 'signupForm') void refreshSignupSchemas()
if (t === 'review') {
void refreshReviewSchemas()
@ -661,6 +671,33 @@ function formatFileSize(size: number | null | undefined): string {
return `${(size / 1024 / 1024).toFixed(1)}MB`
}
const APPLICATION_FILE_KIND_ORDER = ['plan', 'supporting'] as const
function applicationFileKindLabel(kind: string | null | undefined): string {
if (kind === 'plan') return '商业计划书'
if (kind === 'supporting') return '佐证材料'
return kind?.trim() || '其他附件'
}
function applicationFileKindRank(kind: string | null | undefined): number {
const index = APPLICATION_FILE_KIND_ORDER.indexOf(kind as (typeof APPLICATION_FILE_KIND_ORDER)[number])
return index === -1 ? APPLICATION_FILE_KIND_ORDER.length : index
}
function sortApplicationDetailFiles(files: AdminApplicationFileRow[]): AdminApplicationFileRow[] {
return [...files].sort((a, b) => {
const kindDiff = applicationFileKindRank(a.kind) - applicationFileKindRank(b.kind)
if (kindDiff !== 0) return kindDiff
return (a.original_name ?? '').localeCompare(b.original_name ?? '', 'zh-CN')
})
}
const applicationDetailDisplayFiles = computed(() => {
const files = applicationDetail.value?.files
if (!files?.length) return []
return sortApplicationDetailFiles(files)
})
async function refreshApplications(page = applicationPager.value.page) {
const cid = competitionId.value
if (!cid) {
@ -676,6 +713,7 @@ async function refreshApplications(page = applicationPager.value.page) {
keyword: applicationFilters.value.keyword.trim() || undefined,
status: applicationFilters.value.status || undefined,
track: applicationFilters.value.track || undefined,
signup_channel_id: applicationFilters.value.signup_channel_id || undefined,
})
applications.value = res.data
applicationPager.value = {
@ -692,10 +730,66 @@ async function refreshApplications(page = applicationPager.value.page) {
}
function resetApplicationFilters() {
applicationFilters.value = { keyword: '', status: '', track: '' }
applicationFilters.value = { keyword: '', status: 'submitted', track: '', signup_channel_id: undefined }
void refreshApplications(1)
}
async function exportApplications(mode: AdminApplicationExportMode) {
const cid = competitionId.value
if (!cid) return
if (mode === 'selected' && selectedApplications.value.length === 0) {
ElMessage.warning('请先勾选要导出附件的项目')
return
}
applicationsExporting.value = true
applicationsExportProgress.value = '准备导出…'
try {
const meta = await exportAdminApplications(
cid,
{
mode,
keyword: applicationFilters.value.keyword.trim() || undefined,
status: applicationFilters.value.status || undefined,
track: applicationFilters.value.track || undefined,
signup_channel_id: applicationFilters.value.signup_channel_id || undefined,
application_ids:
mode === 'selected' ? selectedApplications.value.map((row) => row.id) : undefined,
},
(current, total) => {
if (mode === 'xlsx') {
applicationsExportProgress.value = '正在下载表格…'
return
}
applicationsExportProgress.value = `正在下载第 ${current}/${total} 个 ZIP…`
},
)
if (mode === 'xlsx') {
ElMessage.success(`已导出 ${meta.total} 条报名记录表格`)
} else if (mode === 'selected') {
ElMessage.success(
meta.part_count > 1
? `已下载 ${meta.part_count} 个 ZIP(含全部筛选表格与 ${selectedApplications.value.length} 个所选项目附件)`
: `已导出表格及 ${selectedApplications.value.length} 个所选项目附件`,
)
} else if (meta.part_count > 1) {
ElMessage.success(
`已下载 ${meta.part_count} 个 ZIP(汇总表仅在第 1 个包,每个约 ${meta.part_size} 条项目附件)`,
)
} else {
ElMessage.success('导出已开始下载')
}
} catch (e) {
ElMessage.error(e instanceof Error ? e.message : '导出失败')
} finally {
applicationsExporting.value = false
applicationsExportProgress.value = ''
}
}
function onApplicationSelectionChange(rows: AdminApplicationRow[]) {
selectedApplications.value = rows
}
async function openApplicationDetail(row: AdminApplicationRow) {
const cid = competitionId.value
if (!cid) return
@ -1313,7 +1407,7 @@ onMounted(() => {
<el-tab-pane v-if="!isCreate()" label="报名信息" name="applications" lazy>
<div v-loading="applicationsLoading" class="applications-pane">
<div class="pane-toolbar pane-toolbar--split pane-toolbar--wrap">
<div class="applications-toolbar">
<div class="application-filters">
<el-input
v-model="applicationFilters.keyword"
@ -1322,11 +1416,11 @@ onMounted(() => {
class="application-filter-keyword"
@keyup.enter="refreshApplications(1)"
/>
<el-select v-model="applicationFilters.status" placeholder="状态" clearable class="application-filter-select">
<el-select v-model="applicationFilters.status" placeholder="状态" clearable teleported class="application-filter-select">
<el-option label="草稿" value="draft" />
<el-option label="已提交" value="submitted" />
</el-select>
<el-select v-model="applicationFilters.track" placeholder="赛道" clearable class="application-filter-select">
<el-select v-model="applicationFilters.track" placeholder="赛道" clearable teleported class="application-filter-select">
<el-option
v-for="track in tracks"
:key="track.track_code"
@ -1334,14 +1428,61 @@ onMounted(() => {
:value="track.track_code"
/>
</el-select>
<el-select
v-model="applicationFilters.signup_channel_id"
placeholder="渠道"
clearable
filterable
teleported
class="application-filter-select application-filter-channel"
>
<el-option
v-for="channel in channels"
:key="channel.id"
:label="`${channel.channel_name}(${channel.channel_code})`"
:value="channel.id"
/>
</el-select>
</div>
<div class="application-actions">
<el-dropdown trigger="click" @command="exportApplications">
<el-button :loading="applicationsExporting">
{{ applicationsExportProgress || '导出' }}
<span class="export-dropdown-caret">▾</span>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="xlsx">仅导出表格</el-dropdown-item>
<el-dropdown-item command="selected">
导出表格 + 所选项目附件
<span v-if="selectedApplications.length" class="export-selected-count">
(已选 {{ selectedApplications.length }})
</span>
</el-dropdown-item>
<el-dropdown-item command="all">导出表格 + 全部项目附件</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button @click="resetApplicationFilters">重置</el-button>
<el-button type="primary" @click="refreshApplications(1)">查询</el-button>
</div>
</div>
<el-table :data="applications" stripe border empty-text="暂无报名记录" class="workspace-table">
<p v-if="selectedApplications.length" class="applications-selection-hint">
已选择 {{ selectedApplications.length }} 个项目,可使用「导出表格 + 所选项目附件」
</p>
<el-table
:data="applications"
row-key="id"
stripe
border
empty-text="暂无报名记录"
class="workspace-table"
@selection-change="onApplicationSelectionChange"
>
<el-table-column type="selection" width="48" fixed="left" reserve-selection />
<el-table-column prop="project_code" label="项目编号" width="120" show-overflow-tooltip />
<el-table-column label="状态" width="92">
<template #default="{ row }">
<el-tag :type="applicationStatusTag(row.status)" effect="plain">
@ -1358,6 +1499,17 @@ onMounted(() => {
</template>
</el-table-column>
<el-table-column prop="track_title" label="赛道" min-width="130" show-overflow-tooltip />
<el-table-column label="渠道" min-width="150" show-overflow-tooltip>
<template #default="{ row }">
<span class="cell-muted">
{{
row.signup_channel
? `${row.signup_channel.channel_name}(${row.signup_channel.channel_code})`
: row.signup_channel_code || '—'
}}
</span>
</template>
</el-table-column>
<el-table-column prop="contact_mobile" label="手机号" width="128" />
<el-table-column label="用户渠道" min-width="150" show-overflow-tooltip>
<template #default="{ row }">
@ -1630,15 +1782,16 @@ onMounted(() => {
<div v-loading="applicationDetailLoading" class="application-detail">
<template v-if="applicationDetail">
<el-descriptions :column="2" border class="application-detail-section">
<el-descriptions-item label="项目名称" :span="2">
{{ applicationDetail.project_name || '—' }}
</el-descriptions-item>
<el-descriptions-item label="负责人">{{ applicationDetail.player_name || '—' }}</el-descriptions-item>
<el-descriptions-item label="项目编号">{{ applicationDetail.project_code || '—' }}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag :type="applicationStatusTag(applicationDetail.status)" effect="plain">
{{ applicationStatusLabel(applicationDetail.status) }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="项目名称" :span="2">
{{ applicationDetail.project_name || '—' }}
</el-descriptions-item>
<el-descriptions-item label="负责人">{{ applicationDetail.player_name || '—' }}</el-descriptions-item>
<el-descriptions-item label="学校">{{ applicationDetail.school || '—' }}</el-descriptions-item>
<el-descriptions-item label="学历">{{ applicationDetail.degree || '—' }}</el-descriptions-item>
<el-descriptions-item label="手机号">{{ applicationDetail.contact_mobile || '—' }}</el-descriptions-item>
@ -1668,8 +1821,10 @@ onMounted(() => {
<p class="application-intro">{{ applicationDetail.intro || '—' }}</p>
<h3 class="section-title">附件</h3>
<el-table :data="applicationDetail.files" border empty-text="暂无附件" class="workspace-table workspace-table--mb">
<el-table-column prop="kind" label="类型" width="110" />
<el-table :data="applicationDetailDisplayFiles" border empty-text="暂无附件" class="workspace-table workspace-table--mb">
<el-table-column label="类型" width="120">
<template #default="{ row }">{{ applicationFileKindLabel(row.kind) }}</template>
</el-table-column>
<el-table-column label="文件名" min-width="220" show-overflow-tooltip>
<template #default="{ row }">{{ row.original_name || '附件' }}</template>
</el-table-column>
@ -2051,24 +2206,58 @@ onMounted(() => {
}
.application-filters {
display: flex;
align-items: center;
display: grid;
grid-template-columns: minmax(220px, 1fr) 130px 130px minmax(180px, 220px);
gap: 8px;
flex-wrap: wrap;
align-items: center;
}
.applications-toolbar {
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 12px;
}
.application-filter-keyword {
width: min(320px, 100%);
width: 100%;
min-width: 0;
}
.application-filter-select {
width: 150px;
width: 100%;
min-width: 0;
}
.application-filter-channel {
width: 100%;
min-width: 0;
}
.application-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
flex-wrap: wrap;
}
.export-dropdown-caret {
margin-left: 4px;
font-size: 12px;
opacity: 0.75;
}
.export-selected-count {
margin-left: 4px;
color: var(--el-color-primary);
font-size: 12px;
}
.applications-selection-hint {
margin: 0 0 8px;
color: var(--el-text-color-secondary);
font-size: 13px;
}
.table-pagination {

@ -8,7 +8,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy'
import type { Plugin } from 'vite'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const laravelPublicAdmin = path.resolve(__dirname, '../backend/public/admin')
const laravelPublicAdmin = path.resolve(__dirname, '../xxfcyds2026-backend/public/admin')
function spaHistoryFallback(): Plugin {
const middleware = history({ index: '/index.html' })
@ -53,7 +53,7 @@ export default defineConfig(({ mode }) => ({
proxy: {
'/api': {
// cxxfds-service;与本机 php artisan serve 端口一致(8000 常被其它 Laravel 占用时改用 8001)
target: 'http://127.0.0.1:8001',
target: 'http://127.0.0.1:8002',
changeOrigin: true,
},
},
@ -61,7 +61,7 @@ export default defineConfig(({ mode }) => ({
preview: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8001',
target: 'http://127.0.0.1:8002',
changeOrigin: true,
},
},

Loading…
Cancel
Save