修复已知问题
This commit is contained in:
@@ -163,7 +163,10 @@
|
||||
import { createImGroup } from '../../../../api/tui-kit'
|
||||
import { chooseImage } from '../../../../utils/media'
|
||||
import { uploadSingleFile } from '../../../../utils/uploadFile'
|
||||
import { validateGroupNumber } from '../../../../utils/validate'
|
||||
import { useUI } from '../../../../utils/use-ui'
|
||||
|
||||
const { showToast } = useUI()
|
||||
const TUIGroupServer = Server.getInstance()
|
||||
const TUIConstants = TUIGroupServer.constants
|
||||
|
||||
@@ -229,9 +232,7 @@
|
||||
placeholder: TUITranslateService.t('TUIGroup.请输入群名称')
|
||||
}
|
||||
const groupIDInput = {
|
||||
name: `${TUITranslateService.t(
|
||||
'TUIGroup.群ID'
|
||||
)}(${TUITranslateService.t('TUIGroup.选填')})`,
|
||||
name: `群号码`,
|
||||
key: 'groupID',
|
||||
placeholder: '搜索加入群使用'
|
||||
}
|
||||
@@ -241,7 +242,10 @@
|
||||
})
|
||||
|
||||
const submitDisabledStatus = computed(() => {
|
||||
return groupInfo.profile.name === '' && !groupInfo.isEdit
|
||||
return (
|
||||
groupInfo.profile.name === '' ||
|
||||
(groupInfo.profile.groupID === '' && !groupInfo.isEdit)
|
||||
)
|
||||
})
|
||||
|
||||
const selected = (type: any) => {
|
||||
@@ -296,11 +300,15 @@
|
||||
if (options.type === TUIChatEngine.TYPES.GRP_COMMUNITY) {
|
||||
delete options.groupID
|
||||
}
|
||||
const isGroupID = validateGroupNumber(options.groupID)
|
||||
|
||||
if (!isGroupID.valid) {
|
||||
return showToast(isGroupID.message)
|
||||
}
|
||||
const res = await TUIGroupService.createGroup({
|
||||
...options,
|
||||
avatar: groupAvatar.value
|
||||
})
|
||||
console.log(res)
|
||||
const { type } = res.data.group
|
||||
if (type === TUIChatEngine.TYPES.GRP_AVCHATROOM) {
|
||||
await TUIGroupService.joinGroup({
|
||||
@@ -314,10 +322,14 @@
|
||||
type: TOAST_TYPE.SUCCESS
|
||||
})
|
||||
} catch (err: any) {
|
||||
Toast({
|
||||
message: err.message,
|
||||
type: TOAST_TYPE.ERROR
|
||||
})
|
||||
if (err.code === 10025) {
|
||||
showToast('该群组号已存在', 'error')
|
||||
} else {
|
||||
Toast({
|
||||
message: err.message,
|
||||
type: TOAST_TYPE.ERROR
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user