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

View File

@ -1,5 +1,5 @@
<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>
<Header />
@ -311,6 +311,12 @@ const validateAdminPassword = (password) => {
justify-content: center;
}
.main-background {
background-image: url('@/assets/bg.jpeg');
background-size: 'cover';
background-position: 'center';
}
/* 适配移动设备 */
@media (max-width: 640px) {
.max-w-md {

View File

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