Просмотр исходного кода

!1547 修复部分已知bug
Merge pull request !1547 from 喵你个汪/next

zuohuaijun 1 год назад
Родитель
Сommit
72f03ff1c2

+ 6 - 6
Admin.NET/Admin.NET.Core/Service/Config/SysConfigService.cs

@@ -292,12 +292,12 @@ public class SysConfigService : IDynamicApiController, ITransient
             var ext = string.IsNullOrWhiteSpace(input.SysLogoFileName) ? ".png" : Path.GetExtension(input.SysLogoFileName);
             // 本地图标保存路径
             var path = "upload";
-            var absoluteFilePath = Path.Combine(App.WebHostEnvironment.WebRootPath, path, $"logo{ext}");
+            var fileName = $"{app.ViceTitle}-logo{ext}".ToLower();
+            var absoluteFilePath = Path.Combine(App.WebHostEnvironment.WebRootPath, path, fileName);
 
             // 删除已存在文件
-            if (File.Exists(oldSysLogoAbsoluteFilePath))
-                File.Delete(oldSysLogoAbsoluteFilePath);
-
+            if (File.Exists(oldSysLogoAbsoluteFilePath)) File.Delete(oldSysLogoAbsoluteFilePath);
+    
             // 创建文件夹
             var absoluteFileDir = Path.GetDirectoryName(absoluteFilePath);
             if (!Directory.Exists(absoluteFileDir)) Directory.CreateDirectory(absoluteFileDir);
@@ -306,9 +306,9 @@ public class SysConfigService : IDynamicApiController, ITransient
             await File.WriteAllBytesAsync(absoluteFilePath, binData);
 
             // 保存图标配置
-            app.Logo = $"/{path}/logo-{app.ViceTitle}-{ext}";
+            app.Logo = $"/{path}/{fileName}";
         }
-        
+
         app.Title = input.SysTitle;
         app.ViceTitle = input.SysViceTitle;
         app.ViceDesc = input.SysViceDesc;

+ 6 - 4
Web/src/layout/routerView/parent.vue

@@ -21,6 +21,7 @@ import { useKeepALiveNames } from '/@/stores/keepAliveNames';
 import { useThemeConfig } from '/@/stores/themeConfig';
 import { Session } from '/@/utils/storage';
 import mittBus from '/@/utils/mitt';
+import {random} from "lodash-es";
 
 // 引入组件
 const Iframes = defineAsyncComponent(() => import('/@/layout/routerView/iframes.vue'));
@@ -69,10 +70,11 @@ onBeforeMount(() => {
 		state.refreshRouterViewKey = '';
 		state.iframeRefreshKey = '';
 		nextTick(() => {
-			state.refreshRouterViewKey = fullPath;
-			state.iframeRefreshKey = fullPath;
-			state.keepAliveNameList = keepAliveNames.value;
-		});
+      fullPath = (fullPath.indexOf('?') > 0 ? '&' : '?') + '_$t=' + Math.random();
+      state.refreshRouterViewKey = fullPath;
+      state.iframeRefreshKey = fullPath;
+      state.keepAliveNameList = keepAliveNames.value;
+    })
 	});
 });
 // 页面加载时