Compare commits

...

4 Commits
main ... dev

Author SHA1 Message Date
Phoenix
a8fea9ea32 Merge branch 'dev' of http://172.16.100.91:3000/scout666/chat-pc into dev 2025-07-01 15:37:44 +08:00
Phoenix
62cb9c87c2 fix(editor): 移除调试日志并修复图片表情解析逻辑
移除无用的console.log调试语句
修复parseEditorContent中图片表情解析逻辑,正确处理表情文本占位符
优化insertImageEmoji方法,移除多余的空格节点插入
2025-07-01 15:04:36 +08:00
445f8f2e79 Merge pull request 'fix: 更改接口前缀地址' (#6) from yink into dev
Reviewed-on: https://gitea-inner.fontree.cn/scout666/chat-pc/pulls/6
2025-07-01 06:33:58 +00:00
2a1917942d fix: 更改接口前缀地址 2025-07-01 14:33:25 +08:00
3 changed files with 23 additions and 18 deletions

View File

@ -109,3 +109,13 @@ export const ServeAddFriend = (data) => {
export const ServeCheckFriend = (data) => {
return post('/api/v1/contact/friend/check', data)
}
// 检测是否需要加好友
export const GetContactFriendList = (data) => {
return post('/api/v1/contact/friend/list', data)
}
// 搜索好友
export const GetFriendList = (data) => {
return post('/api/v1/contact/friend/search', data)
}

View File

@ -33,7 +33,6 @@ const props = defineProps({
const emit = defineEmits(['editor-event'])
const userStore = useUserStore()
const dialogueStore = useDialogueStore()
console.log('dialogueStore', dialogueStore.talk.talk_type)
const editorDraftStore = useEditorDraftStore()
const editorRef = ref(null)
const content = ref('')
@ -172,7 +171,6 @@ const updateMentionPosition = (range) => {
}
}
const insertMention = (member, clonedRange) => {
console.log('插入mention', member);
const selection = window.getSelection();
if (!clonedRange || !selection || !editorRef.value) return;
const range = clonedRange;
@ -565,20 +563,20 @@ const parseEditorContent = () => {
currentTextBuffer += '\n';
break;
case 'IMG':
flushTextBufferIfNeeded();
const src = node.getAttribute('src');
const alt = node.getAttribute('alt');
const isEmojiPic = node.classList.contains('editor-emoji');
const isTextEmojiPlaceholder = node.classList.contains('emoji');
if (isTextEmojiPlaceholder && alt) {
if ((isEmojiPic || isTextEmojiPlaceholder) && alt) {
currentTextBuffer += alt;
} else if (src) {
flushTextBufferIfNeeded();
items.push({
type: 3,
content: src,
isEmoji: isEmojiPic,
width: node.getAttribute('data-original-width') || node.width || null,
height: node.getAttribute('data-original-height') || node.height || null,
isEmoji: false,
width: node.getAttribute('data-original-width') || node.width,
height: node.getAttribute('data-original-height') || node.height
});
}
break;
@ -887,12 +885,8 @@ const insertImageEmoji = (imgSrc, altText) => {
img.className = 'editor-emoji';
img.setAttribute('data-role', 'emoji');
range.insertNode(img);
const spaceNode = document.createTextNode('\u00A0');
range.setStartAfter(img);
range.collapse(true);
range.insertNode(spaceNode);
range.setStartAfter(spaceNode);
range.collapse(true);
if (selection) {
selection.removeAllRanges();
selection.addRange(range);

View File

@ -26,7 +26,7 @@ import {
import { Search, Plus, Right, AddOne, PeoplePlusOne } from '@icon-park/vue-next'
import TalkItem from './TalkItem.vue'
import Skeleton from './Skeleton.vue'
import { ServeClearTalkUnreadNum, ServeAddFriend } from '@/api/chat'
import { ServeClearTalkUnreadNum, ServeAddFriend, GetFriendList } from '@/api/chat'
import GroupLaunch from '@/components/group/GroupLaunch.vue'
import { getCacheIndexName } from '@/utils/talk'
import { ISession } from '@/types/chat'
@ -38,6 +38,7 @@ import flTree from '@/components/flnlayout/tree/flnindex.vue'
import { processError, processSuccess } from '@/utils/helper/message.js'
import chatAppSearchList from '@/components/search/searchList.vue'
import { ServeSeachQueryAll, ServeQueryTalkRecord, ServeUserGroupChatList } from '@/api/search'
import { GetContactFriendList } from '@/api/chat'
import { getUserInfoByERPUserId } from '@/api/user'
import HighlightText from '@/components/search/highLightText.vue'
import { useRouter } from 'vue-router'
@ -736,8 +737,8 @@ const getMyFriends = () => {
page_size: state.myFriendListPageSize,
name: state.myFriendListSearchName
}
let url = '/api/v1/contact/friend/list'
$request.HTTP.components.postDataByParams(url, params).then((res) => {
// let url = '/api/v1/contact/friend/list'
GetContactFriendList(params).then((res) => {
// console.log(res)
if (res.code === 200 && Array.isArray(res.data.user_list)) {
state.myFriendListData = res.data.user_list || []
@ -749,7 +750,7 @@ const getMyFriends = () => {
//
const getDepPoisUser = () => {
// let url = '/user/v2/list'
let url = '/api/v1/contact/friend/list'
// let url = '/api/v1/contact/friend/list'
// let params = {
// departmentId: state.addressBookSearchNickName ? undefined : state.clickKey,
// page: state.addressBookPage,
@ -770,7 +771,7 @@ const getDepPoisUser = () => {
page_size: state.addressBookPageSize,
name: state.addressBookSearchNickName
}
$request.HTTP.components.postDataByParams(url, params).then((res) => {
GetContactFriendList(params).then((res) => {
// console.log(res)
if (res.code === 200 && Array.isArray(res.data.user_list)) {
state.addressBookData = res.data.user_list || []
@ -884,8 +885,8 @@ const changeAddFriendSearch = (value) => {
let params = {
name: value.friendName
}
let url = '/api/v1/contact/friend/search'
$request.HTTP.components.postDataByParams(url, params).then((res) => {
// let url = '/api/v1/contact/friend/search'
GetFriendList(params).then((res) => {
// console.log(res)
if (res.code === 200) {
state.addFriendList = res.data?.user_list || []