Преглед изворни кода

优化-列表中将常量值转文本、缓存常量字典

zuohuaijun пре 4 година
родитељ
комит
7ed126527c

+ 6 - 0
Admin.NET/Admin.NET.Core/Admin.NET.Core.xml

@@ -4053,6 +4053,12 @@
             <param name="typeName"></param>
             <returns></returns>
         </member>
+        <member name="M:Admin.NET.Core.Service.ConstSelectorService.GetAllConstSelectorWithOptions">
+            <summary>
+            获取所有下拉框及选项  用于前端缓存
+            </summary>
+            <returns></returns>
+        </member>
         <member name="M:Admin.NET.Core.Service.ConstSelectorService.GetAllTypesAsync">
             <summary>
             获取所有常量

+ 4 - 9
Admin.NET/Admin.NET.Core/Service/ConstSelector/ConstSelectorService.cs

@@ -4,14 +4,13 @@
 /// 常量下拉框服务
 /// </summary>
 [ApiDescriptionSettings(Name = "常量下拉框", Order = 189)]
+[AllowAnonymous]
 public class ConstSelectorService : IDynamicApiController, ITransient
 {
-    //private readonly IDistributedCache _cache;
     private readonly ISysCacheService _sysCacheService;
-    public ConstSelectorService(IDistributedCache cache,
-        ISysCacheService sysCacheService)
+
+    public ConstSelectorService(ISysCacheService sysCacheService)
     {
-        //_cache = cache;
         _sysCacheService = sysCacheService;
     }
 
@@ -19,7 +18,6 @@ public class ConstSelectorService : IDynamicApiController, ITransient
     /// 获取所有常量下拉框列表
     /// </summary>
     /// <returns></returns>
-    [AllowAnonymous]
     [HttpGet("/constSelector/allConstSelector")]
     public async Task<List<SelectorDto>> GetAllConstSelector()
     {
@@ -44,7 +42,6 @@ public class ConstSelectorService : IDynamicApiController, ITransient
     /// </summary>
     /// <param name="typeName"></param>
     /// <returns></returns>
-    [AllowAnonymous]
     [HttpGet("/constSelector/constSelector")]
     public async Task<List<SelectorDto>> GetConstSelector(string typeName)
     {
@@ -73,7 +70,6 @@ public class ConstSelectorService : IDynamicApiController, ITransient
     /// 获取所有下拉框及选项  用于前端缓存
     /// </summary>
     /// <returns></returns>
-    [AllowAnonymous]
     [HttpGet("/constSelector/allConstSelectorWithOptions")]
     public async Task<List<SelectorDto>> GetAllConstSelectorWithOptions()
     {
@@ -100,5 +96,4 @@ public class ConstSelectorService : IDynamicApiController, ITransient
             return typeList;
         });
     }
-}
-
+}

+ 10 - 0
doc/Vben2前端框架修改记录.txt

@@ -60,6 +60,16 @@ Vben2/index.html
 \src\utils\http\axios
 14、解决表格设置不加载列名选项的问题
 /src/components/Table/src/components/settings/ColumnSetting.vue 
+15、增加注册常量下拉框
+Vben2/src/main.ts	
+16、增加缓存所有常量下拉框数据
+Vben2/src/router/guard/permissionGuard.ts	
+17、增加获取所有常量下拉框
+Vben2/src/store/modules/user.ts	
+18、增加常量下拉框帮助类
+Vben2/src/utils/helper/constSelectorHelper.ts	
+19、
+
 
 
 /////////////////////////////////////////////////////////////////////