fix: 배포 후 관리자 세션 복구 처리
This commit is contained in:
@@ -169,6 +169,41 @@ button:disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.admin-reconnect-modal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.admin-reconnect-modal.components-reconnect-show,
|
||||
.admin-reconnect-modal.components-reconnect-failed,
|
||||
.admin-reconnect-modal.components-reconnect-rejected {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 10000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
background: rgba(15, 23, 42, 0.48);
|
||||
}
|
||||
|
||||
.admin-reconnect-card {
|
||||
width: min(420px, 100%);
|
||||
padding: 24px;
|
||||
border-radius: 16px;
|
||||
background: #fff;
|
||||
box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
|
||||
}
|
||||
|
||||
.admin-reconnect-card strong,
|
||||
.admin-reconnect-card span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.admin-reconnect-card span {
|
||||
margin-top: 8px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 600px) {
|
||||
.mud-container-maxwidth-small {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
window.taxbaikAdminSession = {
|
||||
clearAuthToken: function () {
|
||||
try {
|
||||
localStorage.removeItem('auth_token');
|
||||
} catch {
|
||||
// Ignore storage errors; redirect still recovers the session.
|
||||
}
|
||||
},
|
||||
watchReconnect: function () {
|
||||
const modal = document.getElementById('components-reconnect-modal');
|
||||
if (!modal) {
|
||||
return;
|
||||
}
|
||||
|
||||
const reloadOnRejectedCircuit = () => {
|
||||
const className = modal.className || '';
|
||||
if (className.includes('components-reconnect-failed') ||
|
||||
className.includes('components-reconnect-rejected')) {
|
||||
window.setTimeout(() => window.location.reload(), 1500);
|
||||
}
|
||||
};
|
||||
|
||||
new MutationObserver(reloadOnRejectedCircuit)
|
||||
.observe(modal, { attributes: true, attributeFilter: ['class'] });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user