Browse Source

😁修复遍历常量错误及个人中心错误

zuohuaijun 2 năm trước cách đây
mục cha
commit
567f2e308c

+ 1 - 1
Admin.NET/Admin.NET.Core/Service/Const/SysConstService.cs

@@ -80,7 +80,7 @@ public class SysConstService : IDynamicApiController, ITransient
     /// <returns></returns>
     private List<Type> GetConstAttributeList()
     {
-        return AppDomain.CurrentDomain.GetAssemblies().SelectMany(u => u.GetTypes())
+        return AppDomain.CurrentDomain.GetAssemblies().SelectMany(u => u.GetExportedTypes())
             .Where(u => u.CustomAttributes.Any(c => c.AttributeType == typeof(ConstAttribute))).ToList();
     }
 }

+ 10 - 8
Web/src/views/system/user/component/orgTree.vue

@@ -67,14 +67,16 @@ onMounted(async () => {
 
 // 递归遍历
 const InitOrg = (orgData: any, id: any) => {
-	orgData.forEach(function (u: any) {
-		if (u.id == id) {
-			u.style = currentNodeStyle;
-			return;
-		} else if (u.children && u.children.length > 0) {
-			InitOrg(u.children, id);
-		}
-	});
+	if(orgData && orgData.length > 0) {
+		orgData.forEach(function (u: any) {
+			if (u.id == id) {
+				u.style = currentNodeStyle;
+				return;
+			} else {
+				InitOrg(u.children, id);
+			}
+		});
+	}
 };
 </script>