Browse Source

修正相册左菜单点不了的问题

moshaorui 5 days ago
parent
commit
ede83ab19d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/Admin/Controllers/SiteAlbumController.php

+ 2 - 2
app/Admin/Controllers/SiteAlbumController.php

@@ -86,8 +86,8 @@ class SiteAlbumController extends AdminController
 <<<JS
 // 使用定时器检测容器是否存在
 const interval = setInterval(() => {
-    const containerUl = document.querySelector('.jstree-container-ul');
-    if (containerUl) {
+    const containerUl = document.getElementsByClassName('jstree-node');
+    if (containerUl.length > 0) {
         clearInterval(interval); // 找到容器后停止检测
         // 以下是原有逻辑(已优化)
         const folderId = $('select[name="folder_id"]').data('value'); // 提取 folderId 到外层,避免重复查询[1](@ref)