Эх сурвалжийг харах

feat: redirect to admin.php after successful login

Instead of calling hideLoginModal() and loadLinks(), the login now redirects to admin.php, providing direct access to the admin panel.
caesar 2 сар өмнө
parent
commit
bb7108decf
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      public/index.php

+ 1 - 1
public/index.php

@@ -271,7 +271,7 @@
       if(!pwd){ loginError.textContent = '请输入密码'; loginError.style.display = ''; return; }
       loginConfirm.disabled = true; loginConfirm.textContent = '登录中…';
       apiPost('login', {password: pwd}).then(data => {
-        if(data.success){ hideLoginModal(); loadLinks(); }
+        if(data.success){ window.location.href = 'admin.php'; }
         else { loginError.textContent = data.error || '密码错误'; loginError.style.display = ''; loginConfirm.disabled = false; loginConfirm.textContent = '登录'; }
       }).catch(e => {
         loginError.textContent = e.message; loginError.style.display = '';