调整V3下isSelfUser的判定

This commit is contained in:
yoimiya-kokomi 2022-09-17 21:16:48 +08:00
parent 122565722b
commit d203b2743d

View File

@ -32,15 +32,15 @@ class User {
class Mys { class Mys {
constructor (e, uid, MysApi) { constructor (e, uid, MysApi) {
let ckUid = MysApi.ckInfo?.uid
this.selfUser = new User({ id: e.user_id, uid }) this.selfUser = new User({ id: e.user_id, uid })
this.targetUser = { this.targetUser = this.selfUser
uid
}
this.e = e this.e = e
this.MysApi = MysApi this.MysApi = MysApi
e.targetUser = this.targetUser e.targetUser = this.targetUser
e.selfUser = this.selfUser e.selfUser = this.selfUser
e.isSelfCookie = true e.isSelfCookie = uid === ckUid
} }
async getData (api, data) { async getData (api, data) {
@ -104,7 +104,7 @@ class Mys {
} }
get isSelfCookie () { get isSelfCookie () {
return true return this.e.isSelfCookie
} }
} }
@ -124,7 +124,6 @@ export async function getMysApi (e, cfg) {
return false return false
} }
} }
e.isSelfCookie = uid !== ckUid
return new Mys(e, uid, MysApi) return new Mys(e, uid, MysApi)
} }