修复若干bug

This commit is contained in:
hero920103 committed 2026-11-09 11:42:23 +08:00
1 parent ee49ef15b5
commit 244b4bd9fd
12 files changed
+329 -83

No files matched your search

+60 -3
View File
@@ -4,15 +4,21 @@
<div class="not-found-big">404</div>
<div class="not-found-message">页面未找到</div>
<div class="not-found-desc">很抱歉,您访问的页面不存在或已被删除。</div>
<a href="javascript:void(0)" class="back-home-btn" @click.prevent="backToHome">
返回首页
</a>
<div class="action-btns">
<a href="javascript:void(0)" class="back-home-btn" @click.prevent="backToHome">
返回首页
</a>
<a href="javascript:void(0)" class="clear-cache-btn" @click.prevent="clearCache">
清除缓存
</a>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
const router = useRouter();
@@ -20,6 +26,34 @@ const backToHome = () => {
// 使用 /home 作为首页(Hash模式下的系统导航页)
router.push("/home");
};
const clearAllCookies = () => {
const cookies = document.cookie ? document.cookie.split(";") : [];
for (const cookie of cookies) {
const eqPos = cookie.indexOf("=");
const name = eqPos > -1 ? cookie.slice(0, eqPos).trim() : cookie.trim();
if (!name) continue;
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${location.hostname}`;
}
};
const clearCache = async () => {
try {
await ElMessageBox.confirm("确定要清除本地缓存和 Cookie 吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
});
localStorage.clear();
sessionStorage.clear();
clearAllCookies();
ElMessage.success("缓存已清除");
window.location.reload();
} catch {
// 用户取消,不做任何操作
}
};
</script>
<style scoped>
@@ -63,6 +97,12 @@ const backToHome = () => {
margin-bottom: 28px;
}
.action-btns {
display: flex;
gap: 12px;
justify-content: center;
}
.back-home-btn {
display: inline-block;
background: linear-gradient(90deg, #6a82fb 0%, #fc5c7d 100%);
@@ -80,6 +120,23 @@ const backToHome = () => {
background: linear-gradient(-90deg, #6a82fb 0%, #fc5c7d 100%);
}
.clear-cache-btn {
display: inline-block;
background: #fff;
color: #fc5c7d;
padding: 10px 36px;
border-radius: 24px;
font-size: 16px;
text-decoration: none;
font-weight: 500;
border: 1px solid #fc5c7d;
transition: background 0.2s;
}
.clear-cache-btn:hover {
background: #fff0f3;
}
@keyframes float-in {
0% {
transform: translateY(30px) scale(0.97);
@@ -948,7 +948,7 @@ onMounted(load)
/* 展开行样式 */
.expanded-account-box {
padding: 12px 18px;
background-color: #f8fafc;
background-color: var(--el-fill-color-light);
border-radius: 6px;
margin: 6px 0;
}
@@ -982,7 +982,7 @@ onMounted(load)
}
.account-card {
background: #ffffff;
background: var(--el-bg-color);
border: 1px solid var(--el-border-color-lighter);
border-radius: 6px;
padding: 12px;
@@ -1089,7 +1089,7 @@ onMounted(load)
}
.account-edit-card {
background: #f8fafc;
background: var(--el-fill-color-light);
border: 1px solid var(--el-border-color);
border-radius: 6px;
padding: 12px 14px 4px 14px;
@@ -1131,7 +1131,7 @@ onMounted(load)
}
.detail-info-card {
background: #f8fafc;
background: var(--el-fill-color-light);
border-radius: 6px;
padding: 12px 16px;
display: flex;
@@ -1177,7 +1177,7 @@ onMounted(load)
border: 1px solid var(--el-border-color-lighter);
border-radius: 6px;
padding: 12px;
background: #ffffff;
background: var(--el-bg-color);
}
.detail-acc-head {