fix: 用户名通知润色+去修改按钮直接弹改名框
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 15s
Test / e2e-test (push) Failing after 51s
Some checks failed
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 15s
Test / e2e-test (push) Failing after 51s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2099,8 +2099,8 @@ def startup():
|
|||||||
for u in all_users:
|
for u in all_users:
|
||||||
conn.execute(
|
conn.execute(
|
||||||
"INSERT INTO notifications (target_role, title, body, target_user_id) VALUES (?, ?, ?, ?)",
|
"INSERT INTO notifications (target_role, title, body, target_user_id) VALUES (?, ?, ?, ?)",
|
||||||
("viewer", "📢 用户名变更通知",
|
("viewer", "📢 用户名更新提醒",
|
||||||
"系统已取消显示名称,统一使用用户名。你可以在个人设置中修改一次用户名。", u["id"])
|
"为了统一体验,系统已将显示名称合并为用户名。你有一次修改用户名的机会,修改后将不可更改,请慎重选择。", u["id"])
|
||||||
)
|
)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
print(f"[INIT] Synced display_name for {len(needs_sync)} users")
|
print(f"[INIT] Synced display_name for {len(needs_sync)} users")
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
<div v-if="!n.is_read" class="notif-actions">
|
<div v-if="!n.is_read" class="notif-actions">
|
||||||
<!-- 搜索未收录通知:已添加按钮 -->
|
<!-- 搜索未收录通知:已添加按钮 -->
|
||||||
<button v-if="isSearchMissing(n)" class="notif-action-btn notif-btn-added" @click="markAdded(n)">已添加</button>
|
<button v-if="isSearchMissing(n)" class="notif-action-btn notif-btn-added" @click="markAdded(n)">已添加</button>
|
||||||
|
<!-- 用户名更新通知:去修改按钮 -->
|
||||||
|
<button v-else-if="isUsernameNotice(n)" class="notif-action-btn notif-btn-plan" @click="goRename(n)">去修改</button>
|
||||||
<!-- 方案请求通知:去定制按钮 -->
|
<!-- 方案请求通知:去定制按钮 -->
|
||||||
<button v-else-if="isPlanRequest(n)" class="notif-action-btn notif-btn-plan" @click="goPlanDesign(n)">去定制</button>
|
<button v-else-if="isPlanRequest(n)" class="notif-action-btn notif-btn-plan" @click="goPlanDesign(n)">去定制</button>
|
||||||
<!-- 审核类通知:去审核按钮 -->
|
<!-- 审核类通知:去审核按钮 -->
|
||||||
@@ -155,6 +157,15 @@ async function changeUsername() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isUsernameNotice(n) {
|
||||||
|
return n.title && n.title.includes('用户名更新')
|
||||||
|
}
|
||||||
|
|
||||||
|
function goRename(n) {
|
||||||
|
markOneRead(n)
|
||||||
|
changeUsername()
|
||||||
|
}
|
||||||
|
|
||||||
function isPlanRequest(n) {
|
function isPlanRequest(n) {
|
||||||
return n.title && (n.title.includes('方案请求') || n.title.includes('方案需求'))
|
return n.title && (n.title.includes('方案请求') || n.title.includes('方案需求'))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user