😎增加是否开启上线下线通知配置(规避隐私)
This commit is contained in:
parent
b5abbf61df
commit
a421461695
@ -136,6 +136,11 @@ public class ConfigConst
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string SysIdleTimeout = "sys_idle_timeout";
|
public const string SysIdleTimeout = "sys_idle_timeout";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上线通知
|
||||||
|
/// </summary>
|
||||||
|
public const string SysOnlineNotice = "sys_online_notice";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 支付宝授权页面地址
|
/// 支付宝授权页面地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -41,6 +41,7 @@ public class SysConfigSeedData : ISqlSugarEntitySeedData<SysConfig>
|
|||||||
new SysConfig{ Id=1300000000271, Name="显示系统更新日志", Code=ConfigConst.SysUpgrade, Value="True", SysFlag=YesNoEnum.Y, Remark="是否显示系统更新日志", OrderNo=220, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-20 00:00:00") },
|
new SysConfig{ Id=1300000000271, Name="显示系统更新日志", Code=ConfigConst.SysUpgrade, Value="True", SysFlag=YesNoEnum.Y, Remark="是否显示系统更新日志", OrderNo=220, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-20 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000281, Name="多语言切换", Code=ConfigConst.SysI18NSwitch, Value="True", SysFlag=YesNoEnum.Y, Remark="是否显示多语言切换按钮", OrderNo=230, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-20 00:00:00") },
|
new SysConfig{ Id=1300000000281, Name="多语言切换", Code=ConfigConst.SysI18NSwitch, Value="True", SysFlag=YesNoEnum.Y, Remark="是否显示多语言切换按钮", OrderNo=230, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-20 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000291, Name="闲置超时时间", Code=ConfigConst.SysIdleTimeout, Value="0", SysFlag=YesNoEnum.Y, Remark="闲置超时时间(秒),超时强制退出,0 表示不限制", OrderNo=240, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-20 00:00:00") },
|
new SysConfig{ Id=1300000000291, Name="闲置超时时间", Code=ConfigConst.SysIdleTimeout, Value="0", SysFlag=YesNoEnum.Y, Remark="闲置超时时间(秒),超时强制退出,0 表示不限制", OrderNo=240, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2024-12-20 00:00:00") },
|
||||||
|
new SysConfig{ Id=1300000000301, Name="开启上线通知", Code=ConfigConst.SysOnlineNotice, Value="True", SysFlag=YesNoEnum.Y, Remark="开启用户上线、下线通知", OrderNo=250, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2025-06-06 00:00:00") },
|
||||||
|
|
||||||
new SysConfig{ Id=1300000000999, Name="系统版本号", Code=ConfigConst.SysVersion, Value="0", SysFlag=YesNoEnum.Y, Remark= "系统版本号,用于自动升级,请勿手动填写", OrderNo=1000, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2025-04-10 00:00:00") },
|
new SysConfig{ Id=1300000000999, Name="系统版本号", Code=ConfigConst.SysVersion, Value="0", SysFlag=YesNoEnum.Y, Remark= "系统版本号,用于自动升级,请勿手动填写", OrderNo=1000, GroupCode=ConfigConst.SysDefaultGroup, CreateTime=DateTime.Parse("2025-04-10 00:00:00") },
|
||||||
];
|
];
|
||||||
|
|||||||
@ -589,6 +589,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
var passwordExpirationTime = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysPasswordExpirationTime); // 密码有效期
|
var passwordExpirationTime = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysPasswordExpirationTime); // 密码有效期
|
||||||
var i18NSwitch = await _sysConfigService.GetConfigValueByCode<bool>(ConfigConst.SysI18NSwitch); // 开启多语言切换
|
var i18NSwitch = await _sysConfigService.GetConfigValueByCode<bool>(ConfigConst.SysI18NSwitch); // 开启多语言切换
|
||||||
var idleTimeout = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysIdleTimeout); // 闲置超时时间
|
var idleTimeout = await _sysConfigService.GetConfigValueByCode<int>(ConfigConst.SysIdleTimeout); // 闲置超时时间
|
||||||
|
var onlineNotice = await _sysConfigService.GetConfigValueByCode<bool>(ConfigConst.SysOnlineNotice); // 上线下线通知
|
||||||
var publicKey = App.GetConfig<string>("Cryptogram:PublicKey", true); // 获取密码加解密公钥配置
|
var publicKey = App.GetConfig<string>("Cryptogram:PublicKey", true); // 获取密码加解密公钥配置
|
||||||
|
|
||||||
return new
|
return new
|
||||||
@ -614,6 +615,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
//CarouselFiles = carouselFiles,
|
//CarouselFiles = carouselFiles,
|
||||||
I18NSwitch = i18NSwitch,
|
I18NSwitch = i18NSwitch,
|
||||||
IdleTimeout = idleTimeout,
|
IdleTimeout = idleTimeout,
|
||||||
|
OnlineNotice = onlineNotice,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "admin.net.pro",
|
"name": "admin.net.pro",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2.4.33",
|
"version": "2.4.33",
|
||||||
"lastBuildTime": "2025.06.05",
|
"lastBuildTime": "2025.06.06",
|
||||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||||
"author": "zuohuaijun",
|
"author": "zuohuaijun",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -89,7 +89,7 @@
|
|||||||
"@iconify/vue": "^5.0.0",
|
"@iconify/vue": "^5.0.0",
|
||||||
"@plugin-web-update-notification/vite": "^2.0.0",
|
"@plugin-web-update-notification/vite": "^2.0.0",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/node": "^22.15.29",
|
"@types/node": "^22.15.30",
|
||||||
"@types/nprogress": "^0.2.3",
|
"@types/nprogress": "^0.2.3",
|
||||||
"@types/sortablejs": "^1.15.8",
|
"@types/sortablejs": "^1.15.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.33.1",
|
"@typescript-eslint/eslint-plugin": "^8.33.1",
|
||||||
@ -99,7 +99,7 @@
|
|||||||
"@vue/compiler-sfc": "^3.5.16",
|
"@vue/compiler-sfc": "^3.5.16",
|
||||||
"code-inspector-plugin": "^0.20.12",
|
"code-inspector-plugin": "^0.20.12",
|
||||||
"eslint": "^9.28.0",
|
"eslint": "^9.28.0",
|
||||||
"eslint-plugin-vue": "^10.1.0",
|
"eslint-plugin-vue": "^10.2.0",
|
||||||
"globals": "^16.2.0",
|
"globals": "^16.2.0",
|
||||||
"less": "^4.3.0",
|
"less": "^4.3.0",
|
||||||
"openapi-ts-request": "^1.5.0",
|
"openapi-ts-request": "^1.5.0",
|
||||||
|
|||||||
@ -156,6 +156,8 @@ export const useThemeConfig = defineStore('themeConfig', {
|
|||||||
i18NSwitch: true,
|
i18NSwitch: true,
|
||||||
// 闲置超时时间
|
// 闲置超时时间
|
||||||
idleTimeout: 0,
|
idleTimeout: 0,
|
||||||
|
// 上线下线通知
|
||||||
|
onlineNotice: true,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
1
Web/src/types/pinia.d.ts
vendored
1
Web/src/types/pinia.d.ts
vendored
@ -106,5 +106,6 @@ declare interface ThemeConfigState {
|
|||||||
passwordExpirationTime?: number; // 是否验证密码有效期
|
passwordExpirationTime?: number; // 是否验证密码有效期
|
||||||
i18NSwitch: boolean; // 是否开启多语言切换
|
i18NSwitch: boolean; // 是否开启多语言切换
|
||||||
idleTimeout: number; // 闲置超时时间
|
idleTimeout: number; // 闲置超时时间
|
||||||
|
onlineNotice: boolean; // 上线下线通知
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,6 +59,8 @@ export async function loadSysInfo(tenantid: number) {
|
|||||||
themeConfig.value.i18NSwitch = data.i18NSwitch;
|
themeConfig.value.i18NSwitch = data.i18NSwitch;
|
||||||
// 闲置超时时间
|
// 闲置超时时间
|
||||||
themeConfig.value.idleTimeout = data.idleTimeout;
|
themeConfig.value.idleTimeout = data.idleTimeout;
|
||||||
|
// 上线下线通知
|
||||||
|
themeConfig.value.onlineNotice = data.onlineNotice;
|
||||||
// 密码加解密公匙
|
// 密码加解密公匙
|
||||||
window.__env__.VITE_SM_PUBLIC_KEY = data.publicKey;
|
window.__env__.VITE_SM_PUBLIC_KEY = data.publicKey;
|
||||||
|
|
||||||
|
|||||||
@ -62,19 +62,23 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { ElMessageBox, ElNotification } from 'element-plus';
|
import { ElMessageBox, ElNotification } from 'element-plus';
|
||||||
import { throttle } from 'lodash-es';
|
|
||||||
import { signalR } from './signalR';
|
|
||||||
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
import { VxeGridInstance, VxeGridListeners, VxeGridPropTypes } from 'vxe-table';
|
||||||
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
import { useVxeTable } from '/@/hooks/useVxeTableOptionsHook';
|
||||||
|
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
import { Local } from '/@/utils/storage';
|
import { Local } from '/@/utils/storage';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { throttle } from 'lodash-es';
|
||||||
|
import { signalR } from './signalR';
|
||||||
|
|
||||||
import SendMessage from '/@/views/system/onlineUser/component/sendMessage.vue';
|
import SendMessage from '/@/views/system/onlineUser/component/sendMessage.vue';
|
||||||
|
|
||||||
import { getAPI, clearAccessTokens } from '/@/utils/axios-utils';
|
import { getAPI, clearAccessTokens } from '/@/utils/axios-utils';
|
||||||
import { SysOnlineUserApi, SysAuthApi } from '/@/api-services/api';
|
import { SysOnlineUserApi, SysAuthApi } from '/@/api-services/api';
|
||||||
import { SysOnlineUser, PageOnlineUserInput } from '/@/api-services/models';
|
import { SysOnlineUser, PageOnlineUserInput } from '/@/api-services/models';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
|
const storesThemeConfig = useThemeConfig();
|
||||||
|
const { themeConfig } = storeToRefs(storesThemeConfig);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const xGrid = ref<VxeGridInstance>();
|
const xGrid = ref<VxeGridInstance>();
|
||||||
@ -139,7 +143,9 @@ onMounted(async () => {
|
|||||||
online: data.online,
|
online: data.online,
|
||||||
realName: data.realName,
|
realName: data.realName,
|
||||||
};
|
};
|
||||||
notificationThrottle();
|
|
||||||
|
// 开启上线下线通知
|
||||||
|
if (themeConfig.value.onlineNotice) notificationThrottle();
|
||||||
|
|
||||||
// // 自动查询一次
|
// // 自动查询一次
|
||||||
// await handleQuery();
|
// await handleQuery();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user