修复模态框位置问题

main
lee-zt 4 weeks ago
parent 944b8f37f8
commit 5280af67db

@ -174,7 +174,6 @@ watch(() => userStore.userInfo, (newInfo) => {
padding: 0 20px; /* 增加左右内边距,避免内容过于靠边 */
border-bottom: 2px solid #e0e0e0;
background: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(4px); /* 添加毛玻璃效果 */
position: fixed;
top: 0;
width: 100%;

@ -206,7 +206,7 @@ async function login() {
userData.userid = userData.id;
userStore.login(userData);
window.location.reload(); //
ElMessage({
message: '登录成功',
type: 'success',

@ -2,7 +2,7 @@
<div class="welcome-container">
<!-- 上部分欢迎文字 -->
<div class="welcome-header">
欢迎来到珞珈岛珈人
欢迎来到珞珈岛{{ userStore.userInfo?.username ? userStore.userInfo.username : '珈人' }}
</div>
<!-- 中间部分月份日期星期 -->
@ -33,6 +33,7 @@
<script setup lang="js" name="WelcomeCalendar">
import { ref } from 'vue';
import { useUserStore } from '@/stores/user';
const today = new Date();
@ -40,10 +41,31 @@ const today = new Date();
const currentMonthText = ref(['一', '月']); //
const currentDay = ref(today.getDate()); //
const currentWeekday = ref(['星', '期', '日']); //
const userStore = useUserStore();
//
const isCheckedIn = ref(false);
//
const getUserKey = () => {
return userStore.userInfo?.userid || userStore.userInfo?.username || 'guest';
};
//
const checkToday = () => {
const todayStr = new Date().toISOString().slice(0, 10);
const userKey = getUserKey();
return localStorage.getItem(`checkin-${userKey}-${todayStr}`) === '1';
};
//
const checkIn = () => {
const todayStr = new Date().toISOString().slice(0, 10);
const userKey = getUserKey();
isCheckedIn.value = true;
localStorage.setItem(`checkin-${userKey}-${todayStr}`, '1');
};
//
const initializeDate = () => {
const months = [
@ -55,11 +77,7 @@ const initializeDate = () => {
currentMonthText.value = months[today.getMonth()].split('');
currentDay.value = today.getDate();
currentWeekday.value = weekdays[today.getDay()].split('');
};
//
const checkIn = () => {
isCheckedIn.value = true;
isCheckedIn.value = checkToday();
};
//

@ -150,7 +150,7 @@ const userInfo = computed(() => userStore.userInfo);
const router = useRouter();
//
const defaultAvatar = require('@/assets/default-avatar/boy_4.png');
const defaultAvatar = require('@/assets/default-avatar/boy_1.png');
//
const handleAvatarError = "this.onerror=null;this.src='" + defaultAvatar + "'";

Loading…
Cancel
Save