ai修复背景图片不显示的问题

This commit is contained in:
chenqiang 2025-08-12 19:09:49 +08:00
parent c8ca6d0bda
commit 0ea53bb30e
3 changed files with 30 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "electron-exam", "name": "electron-exam",
"version": "0.0.0", "version": "1.0.2",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "electron/main.js", "main": "electron/main.js",
@ -49,7 +49,7 @@
}, },
"build": { "build": {
"appId": "com.example.electron-exam", "appId": "com.example.electron-exam",
"productName": "电子考试系统", "productName": "统计技能考试",
"directories": { "directories": {
"output": "dist-electron" "output": "dist-electron"
}, },

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="welcome-container" style="background-image: url('/src/assets/bg.jpeg'); background-size: cover; background-position: center;"> <div class="welcome-container main-background">
<el-container> <el-container>
<Header /> <Header />
@ -311,10 +311,16 @@ const validateAdminPassword = (password) => {
justify-content: center; justify-content: center;
} }
.main-background {
background-image: url('@/assets/bg.jpeg');
background-size: 'cover';
background-position: 'center';
}
/* 适配移动设备 */ /* 适配移动设备 */
@media (max-width: 640px) { @media (max-width: 640px) {
.max-w-md { .max-w-md {
max-width: 100%; max-width: 100%;
} }
} }
</style> </style>

View File

@ -240,14 +240,27 @@ const fetchLastExam = async () => {
const exitExam = async () => { const exitExam = async () => {
try { try {
if (!confirm('确定要退出考试吗?')) { // Element Plus
return ElMessageBox.confirm(
} '确定要退出考试吗?',
userStore.state.isLoggedIn = false '退出确认',
router.push('/') {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
// store
userStore.clearExaminee();
//
router.push('/');
}).catch(() => {
//
console.log('用户取消退出');
});
} catch (error) { } catch (error) {
console.error('退出考试失败:', error) console.error('退出考试失败:', error);
ElMessage.error(`退出考试失败: ${error.message || '未知错误'}`) ElMessage.error(`退出考试失败: ${error.message || '未知错误'}`);
} }
} }