隔离系统通知配置权限并保留各角色个人设置

个人扫码绑定实现前检查点;补充权限与账户隔离回归用例,业务实机验收尚未执行。
This commit is contained in:
xuans committed 2026-09-28 20:57:56 +08:00
1 parent 890660cf38
commit 8104998417
9 files changed
+196 -19

No files matched your search

@@ -151,7 +151,10 @@ export function usePage(pageKey = 'base') {
const hasChanges = computed(() => editorText.value !== loadedText.value || !!secretValue.value || !!savedGeneration.value)
const hasConfigChanges = computed(() => editorText.value !== loadedText.value || (!pluginSecretPage.value && !!secretValue.value) || !!savedGeneration.value)
const canWrite = computed(() => globalStatus.hasCapability(apiSection() === 'plugins' ? 'plugin.write_global' : 'config.write_global'))
const canWrite = computed(() => {
if (pluginSecretPage.value && globalStatus.role !== 'super_admin') return false
return globalStatus.hasCapability(apiSection() === 'plugins' ? 'plugin.write_global' : 'config.write_global')
})
const canRollback = computed(() => globalStatus.hasCapability('config.rollback'))
const canMigrate = computed(() => globalStatus.hasCapability('database.migrate'))
const canRestart = computed(() => globalStatus.hasCapability('service.restart'))
@@ -16,8 +16,10 @@ export function usePage() {
// 全局配置不依赖正在运行的插件列表,未启用的插件也必须可以配置。
const sectionOptions = computed(() => store.hasCapability('plugin.read_global') ? [
{ value: 'spam_block', label: '垃圾邮件拦截', kind: 'config' },
{ value: 'telegram_push', label: 'Telegram 推送', kind: 'config' },
{ value: 'wechat_push', label: '微信推送', kind: 'config' }
...(store.role === 'super_admin' ? [
{ value: 'telegram_push', label: '系统 Telegram 推送', kind: 'config' },
{ value: 'wechat_push', label: '系统微信推送', kind: 'config' }
] : [])
] : [])
const accountOptions = computed(() => store.hasCapability('plugin.read') && store.hasCapability('plugin.write_own')
? [{ value: 'telegram-user', label: 'Telegram 通知', kind: 'account' }]