File tree Expand file tree Collapse file tree
src/wechat_decrypt_tool/routers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1032,15 +1032,12 @@ export const useChatMessages = ({
10321032 contactProfileLoading . value = true
10331033 contactProfileError . value = ''
10341034 try {
1035- const response = await api . listChatContacts ( {
1035+ const response = await api . getChatContactProfile ( {
10361036 account,
10371037 source : DEFAULT_CHAT_SOURCE ,
1038- include_friends : true ,
1039- include_groups : true ,
1040- include_officials : true
1038+ username
10411039 } )
1042- const list = Array . isArray ( response ?. contacts ) ? response . contacts : [ ]
1043- const matched = list . find ( ( item ) => String ( item ?. username || '' ) . trim ( ) === username )
1040+ const matched = response ?. contact && typeof response . contact === 'object' ? response . contact : null
10441041 if ( matched ) {
10451042 const normalized = { ...matched , username }
10461043 if ( ! String ( normalized . displayName || '' ) . trim ( ) && displayNameFallback ) {
Original file line number Diff line number Diff line change @@ -514,6 +514,15 @@ export const useApi = () => {
514514 return await request ( url )
515515 }
516516
517+ const getChatContactProfile = async ( params = { } ) => {
518+ const query = new URLSearchParams ( )
519+ if ( params && params . account ) query . set ( 'account' , params . account )
520+ if ( params && params . source ) query . set ( 'source' , params . source )
521+ if ( params && params . username ) query . set ( 'username' , params . username )
522+ const url = '/chat/contacts/profile' + ( query . toString ( ) ? `?${ query . toString ( ) } ` : '' )
523+ return await request ( url )
524+ }
525+
517526 const exportChatContacts = async ( payload = { } ) => {
518527 return await request ( '/chat/contacts/export' , {
519528 method : 'POST' ,
@@ -728,6 +737,7 @@ export const useApi = () => {
728737 getSnsExport,
729738 cancelSnsExport,
730739 listChatContacts,
740+ getChatContactProfile,
731741 exportChatContacts,
732742 createAccountArchiveExport,
733743 getAccountArchiveExport,
You can’t perform that action at this time.
0 commit comments