feat: 购油方案功能 #28
@@ -2099,8 +2099,8 @@ def startup():
|
||||
for u in all_users:
|
||||
conn.execute(
|
||||
"INSERT INTO notifications (target_role, title, body, target_user_id) VALUES (?, ?, ?, ?)",
|
||||
("viewer", "📢 用户名变更通知",
|
||||
"系统已取消显示名称,统一使用用户名。你可以在个人设置中修改一次用户名。", u["id"])
|
||||
("viewer", "📢 用户名更新提醒",
|
||||
"为了统一体验,系统已将显示名称合并为用户名。你有一次修改用户名的机会,修改后将不可更改,请慎重选择。", u["id"])
|
||||
)
|
||||
conn.commit()
|
||||
print(f"[INIT] Synced display_name for {len(needs_sync)} users")
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
<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-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>
|
||||
<!-- 审核类通知:去审核按钮 -->
|
||||
@@ -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) {
|
||||
return n.title && (n.title.includes('方案请求') || n.title.includes('方案需求'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user