diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs index 5cb16f78..3e71211a 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs @@ -62,10 +62,10 @@ namespace AuthServer.Host options.Languages.Add(new LanguageInfo("en", "en", "English")); }); - context.Services.AddStackExchangeRedisCache(options => - { - options.Configuration = configuration["Redis:Configuration"]; - }); + //context.Services.AddStackExchangeRedisCache(options => + //{ + // options.Configuration = configuration["Redis:Configuration"]; + //}); context.Services.AddCors(options => { @@ -90,9 +90,9 @@ namespace AuthServer.Host options.ApplicationName = "AuthServer"; }); - var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); - context.Services.AddDataProtection() - .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys"); + //var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + //context.Services.AddDataProtection() + // .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys"); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs index d8318944..38f03882 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs @@ -1,4 +1,4 @@ -using BaseService.EntityFrameworkCore; +using BaseService.EntityFrameworkCore; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; @@ -145,14 +145,14 @@ namespace BaseService private static void ConfigureRedis(ServiceConfigurationContext context, IConfiguration configuration) { - context.Services.AddStackExchangeRedisCache(options => - { - options.Configuration = configuration["Redis:Configuration"]; - }); + //context.Services.AddStackExchangeRedisCache(options => + //{ + // options.Configuration = configuration["Redis:Configuration"]; + //}); - var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); - context.Services.AddDataProtection() - .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys"); + //var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + //context.Services.AddDataProtection() + // .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys"); } private void ConfigureDbContext() @@ -271,4 +271,4 @@ namespace BaseService }); } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs index 0f2868cc..6aa861e5 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs @@ -375,18 +375,18 @@ namespace Win.Sfs.SettleAccount { var hostingEnvironment = context.Services.GetHostingEnvironment(); - context.Services.AddStackExchangeRedisCache(options => - { - options.Configuration = configuration["Redis:Configuration"]; - }); + //context.Services.AddStackExchangeRedisCache(options => + //{ + // options.Configuration = configuration["Redis:Configuration"]; + //}); - if (!hostingEnvironment.IsDevelopment()) - { - var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); - context.Services - .AddDataProtection() - .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys"); - } + //if (!hostingEnvironment.IsDevelopment()) + //{ + // var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + // context.Services + // .AddDataProtection() + // .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys"); + //} } private void ConfigureHangfire(ServiceConfigurationContext context, IConfiguration configuration) @@ -460,4 +460,4 @@ namespace Win.Sfs.SettleAccount }); } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js index e5f1a923..ad3edcf0 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/app.js @@ -2,13 +2,16 @@ import html from "html"; import { ElConfigProvider } from "element-plus"; import zh from "./lib/element-plus/locale/zh-cn.min.mjs"; import en from "./lib/element-plus/locale/en.min.mjs"; -import { reactive, onMounted } from "vue"; +import { reactive, onMounted, onUnmounted } from "vue"; +import { ElNotification } from "element-plus"; +import { dayjs } from "element-plus"; export default { components: { ElConfigProvider }, template: html` + `, setup() { @@ -18,7 +21,20 @@ export default { ["en", en], ]) ); - onMounted(() => document.querySelector("#loading.loading").classList.remove("loading")); + const event = "Refresh"; + onMounted(() => { + document.querySelector("#loading.loading").classList.remove("loading"); + PubSub.subscribe(event, async () => { + await ElNotification.closeAll(); + ElNotification({ + type: "warning", + title: `${dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")}`, + dangerouslyUseHTMLString: true, + message: `站点已更新,点击刷新!`, + }); + }); + }); + onUnmounted(() => PubSub.unsubscribe(event)); return { localeMap, }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html index 89c3c2b0..39a1096f 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/index.html @@ -4,6 +4,9 @@ + + +