mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
feat: 宇宙超级无敌牛且帅气到爆炸的功能更新和优化
This commit is contained in:
@@ -30,6 +30,9 @@ export interface ChatSession {
|
||||
lastMsgType: number
|
||||
displayName?: string
|
||||
avatarUrl?: string
|
||||
lastMsgSender?: string
|
||||
lastSenderDisplayName?: string
|
||||
selfWxid?: string
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
@@ -287,6 +290,7 @@ class ChatService {
|
||||
// 转换为 ChatSession(先加载缓存,但不等待数据库查询)
|
||||
const sessions: ChatSession[] = []
|
||||
const now = Date.now()
|
||||
const myWxid = this.configService.get('myWxid')
|
||||
|
||||
for (const row of rows) {
|
||||
const username =
|
||||
@@ -340,7 +344,10 @@ class ChatService {
|
||||
lastTimestamp: lastTs,
|
||||
lastMsgType,
|
||||
displayName,
|
||||
avatarUrl
|
||||
avatarUrl,
|
||||
lastMsgSender: row.last_msg_sender, // 数据库返回字段
|
||||
lastSenderDisplayName: row.last_sender_display_name, // 数据库返回字段
|
||||
selfWxid: myWxid
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -36,12 +36,30 @@ interface ConfigSchema {
|
||||
|
||||
// 更新相关
|
||||
ignoredUpdateVersion: string
|
||||
|
||||
// 通知
|
||||
notificationEnabled: boolean
|
||||
notificationPosition: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
|
||||
notificationFilterMode: 'all' | 'whitelist' | 'blacklist'
|
||||
notificationFilterList: string[]
|
||||
}
|
||||
|
||||
export class ConfigService {
|
||||
private store: Store<ConfigSchema>
|
||||
private static instance: ConfigService
|
||||
private store!: Store<ConfigSchema>
|
||||
|
||||
static getInstance(): ConfigService {
|
||||
if (!ConfigService.instance) {
|
||||
ConfigService.instance = new ConfigService()
|
||||
}
|
||||
return ConfigService.instance
|
||||
}
|
||||
|
||||
constructor() {
|
||||
if (ConfigService.instance) {
|
||||
return ConfigService.instance
|
||||
}
|
||||
ConfigService.instance = this
|
||||
this.store = new Store<ConfigSchema>({
|
||||
name: 'WeFlow-config',
|
||||
defaults: {
|
||||
@@ -72,7 +90,11 @@ export class ConfigService {
|
||||
authPassword: '',
|
||||
authUseHello: false,
|
||||
|
||||
ignoredUpdateVersion: ''
|
||||
ignoredUpdateVersion: '',
|
||||
notificationEnabled: true,
|
||||
notificationPosition: 'top-right',
|
||||
notificationFilterMode: 'all',
|
||||
notificationFilterList: []
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user