mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix getIpLocation (fix #4690)
This commit is contained in:
parent
917b0690e9
commit
1899c12f25
@ -4,9 +4,8 @@ import { defineComponentMetadata } from '@/components/define'
|
||||
import { CommentItem, CommentReplyItem } from '@/components/utils/comment-apis'
|
||||
|
||||
// 新版评论区IP属地获取
|
||||
const getIpLocation = (element: HTMLElement) => {
|
||||
const props = (element as any).__vueParentComponent?.props
|
||||
const reply = props?.reply ?? props?.subReply
|
||||
const getIpLocation = (item: CommentReplyItem) => {
|
||||
const reply = item.vueProps
|
||||
return reply?.reply_control?.location ?? undefined
|
||||
}
|
||||
|
||||
@ -268,7 +267,7 @@ observer.observe(document.head, { childList: true })
|
||||
|
||||
const processItems = (items: CommentReplyItem[]) => {
|
||||
items.forEach(item => {
|
||||
const location = getIpLocation(item.element)
|
||||
const location = getIpLocation(item)
|
||||
if (location !== undefined) {
|
||||
const replyTime =
|
||||
item.element.querySelector('.reply-info>.reply-time') ??
|
||||
|
||||
Loading…
Reference in New Issue
Block a user