From 80bea6b985f507ae55871f40db05e7ab7e996070 Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Mon, 20 Apr 2026 20:50:03 +0800 Subject: [PATCH] feat(profile): add comment notification preference toggle Expose commentNotifyEnabled in profile page state, load it from /api/config/me with true fallback, and persist updates when saving profile settings. Made-with: Cursor --- app/pages/me/profile/index.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/pages/me/profile/index.vue b/app/pages/me/profile/index.vue index f029de1..0803354 100644 --- a/app/pages/me/profile/index.vue +++ b/app/pages/me/profile/index.vue @@ -39,6 +39,7 @@ const state = reactive({ linksJson: '[]', publicHomeHeaderTitle: '', publicHomeHeaderIconUrl: '', + commentNotifyEnabled: true, }) const loading = ref(true) @@ -195,6 +196,8 @@ async function load() { state.publicHomeHeaderTitle = typeof cfg.publicHomeHeaderTitle === 'string' ? cfg.publicHomeHeaderTitle : '' state.publicHomeHeaderIconUrl = typeof cfg.publicHomeHeaderIconUrl === 'string' ? cfg.publicHomeHeaderIconUrl : '' + state.commentNotifyEnabled = + typeof cfg.commentNotifyEnabled === 'boolean' ? cfg.commentNotifyEnabled : true } finally { loading.value = false } @@ -239,6 +242,11 @@ async function save() { notify: false, body: { key: 'publicHomeHeaderIconUrl', value: state.publicHomeHeaderIconUrl }, }), + fetchData('/api/config/me', { + method: 'PUT', + notify: false, + body: { key: 'commentNotifyEnabled', value: state.commentNotifyEnabled }, + }), ]) toast.add({ title: '资料已保存', color: 'success' }) try { @@ -305,6 +313,16 @@ async function save() { label="在发现卡片上显示上述地址" /> +
+

+ 通知偏好 +

+ +