This commit is contained in:
idranme 2024-08-28 16:06:40 +08:00
parent da75f59d0d
commit 234167f305
No known key found for this signature in database
GPG Key ID: 926F7B5B668E495F

View File

@ -1,5 +1,5 @@
import { OB11User } from '../../types'
import BaseAction from '../BaseAction'
import { OB11User } from '../../types'
import { ActionName } from '../types'
import { selfInfo } from '@/common/globalVars'
@ -7,9 +7,13 @@ class GetLoginInfo extends BaseAction<null, OB11User> {
actionName = ActionName.GetLoginInfo
protected async _handle(payload: null) {
let nickname = selfInfo.nick
try {
nickname = await this.ctx.ntUserApi.getSelfNick(true)
} catch { }
return {
user_id: parseInt(selfInfo.uin),
nickname: await this.ctx.ntUserApi.getSelfNick(true)
nickname
}
}
}