发送红包接口有问题,添加群恢复

This commit is contained in:
bobobobo
2026-01-08 01:44:39 +08:00
parent 1634425c17
commit c0619ea4ec
20 changed files with 2070 additions and 1531 deletions

View File

@@ -238,7 +238,11 @@
import Server from '../server'
import { enableSampleTaskStatus } from '../../../utils/enableSampleTaskStatus'
import { IFriendProfile, IGroupMember } from '../../../interface'
import { createImGroup, deleteImGroup, quitImGroup } from '../../../../api/tui-kit'
import {
createImGroup,
deleteImGroup,
quitImGroup
} from '../../../../api/tui-kit'
const TUIGroupServer = Server.getInstance()
const TUIConstants = TUIGroupServer.constants
@@ -400,47 +404,63 @@
const updateProfile = async (newGroupProfile: any) => {
const { key, value } = newGroupProfile
if (key === 'muteAllMembers') {
const options: any = {
groupID: currentGroup.value.groupID,
[key]: value
}
TUIGroupService.updateGroupProfile(options)
.then((res: any) => {
console.log(res.data)
currentGroup.value = res.data.group
editLableName.value = ''
})
.catch((error: any) => {
Toast({
message: error?.message,
type: TOAST_TYPE.ERROR
})
})
} else {
const newKey = {
notification: 'notification',
name: 'groupName'
}[key]
const options: any = {
groupId: currentGroup.value.groupID,
[newKey]: value
}
await createImGroup(options, 'put')
TUIGroupService.getGroupProfile({
groupID: currentGroup.value.groupID
})
.then((res: any) => {
currentGroup.value = res.data.group
editLableName.value = ''
})
.catch((error: any) => {
Toast({
message: error?.message,
type: TOAST_TYPE.ERROR
})
})
const options: any = {
groupID: currentGroup.value.groupID,
[key]: value
}
TUIGroupService.updateGroupProfile(options)
.then((res: any) => {
console.log(res.data)
currentGroup.value = res.data.group
editLableName.value = ''
})
.catch((error: any) => {
Toast({
message: error?.message,
type: TOAST_TYPE.ERROR
})
})
// if (key === 'muteAllMembers') {
// const options: any = {
// groupID: currentGroup.value.groupID,
// [key]: value
// }
// TUIGroupService.updateGroupProfile(options)
// .then((res: any) => {
// console.log(res.data)
// currentGroup.value = res.data.group
// editLableName.value = ''
// })
// .catch((error: any) => {
// Toast({
// message: error?.message,
// type: TOAST_TYPE.ERROR
// })
// })
// } else {
// const newKey = {
// notification: 'notification',
// name: 'groupName'
// }[key]
// const options: any = {
// groupId: currentGroup.value.groupID,
// [newKey]: value
// }
// await createImGroup(options, 'put')
// TUIGroupService.getGroupProfile({
// groupID: currentGroup.value.groupID
// })
// .then((res: any) => {
// currentGroup.value = res.data.group
// editLableName.value = ''
// })
// .catch((error: any) => {
// Toast({
// message: error?.message,
// type: TOAST_TYPE.ERROR
// })
// })
// }
}
const setCurrentTab = (tabName: string) => {
@@ -656,8 +676,8 @@
}
const dismissGroup = async (group: any) => {
await deleteImGroup(group.groupID)
// await TUIGroupService.dismissGroup(group.groupID);
// await deleteImGroup(group.groupID)
await TUIGroupService.dismissGroup(group.groupID)
enableSampleTaskStatus('dismissGroup')
Toast({
message: TUITranslateService.t('TUIGroup.群组解散成功'),
@@ -874,8 +894,8 @@
}
const quitGroup = async (group: any) => {
await quitImGroup(group.groupID)
// await TUIGroupService.quitGroup(group.groupID)
// await quitImGroup(group.groupID)
await TUIGroupService.quitGroup(group.groupID)
clearGroupInfo()
}