Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Web/web-vite-vue3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tencentcloud/live-uikit-vue",
"version": "6.3.0",
"version": "6.5.0",
"scripts": {
"dev": "vite --force",
"dev:business": "cross-env STYLE_PRESET=business vite --force",
Expand All @@ -18,16 +18,16 @@
"lint": "./node_modules/.bin/eslint ./src --no-error-on-unmatched-pattern"
},
"dependencies": {
"@tencentcloud/tuiroom-engine-js": "~4.2.0",
"@tencentcloud/uikit-base-component-vue3": "1.4.5",
"@tencentcloud/tuiroom-engine-js": "~4.2.2",
"@tencentcloud/uikit-base-component-vue3": "1.4.8",
"@tencentcloud/universal-api": "^2.0.9",
"axios": "^0.27.2",
"js-cookie": "^3.0.1",
"mitt": "^3.0.0",
"pinia": "^2.0.13",
"qs": "^6.10.3",
"rtc-detect": "^1.0.3",
"tuikit-atomicx-vue3": "6.3.0",
"tuikit-atomicx-vue3": "6.5.0",
"vue": "^3.2.25",
"vue-i18n": "^9.10.2",
"vue-router": "^4.0.14"
Expand Down
9 changes: 8 additions & 1 deletion Web/web-vite-vue3/src/TUILiveKit/LivePusherView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<div class="main-center">
<div class="main-center-top">
<div class="main-center-top-left">
{{ currentLive?.liveName || liveParams.liveName }}
<span class="live-name">{{ currentLive?.liveName || liveParams.liveName }}</span>
<LiveSettingButton
v-if="loginUserInfo?.userId"
:live-name="currentLive?.liveName || liveParams.liveName"
Expand Down Expand Up @@ -606,6 +606,13 @@ onUnmounted(() => {
align-items: center;
gap: 8px;

.live-name {
max-width: 280px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.copy-icon {
cursor: pointer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:src="currentLive?.liveOwner.avatarUrl" :size="32"
:style="{ border: '1px solid var(--uikit-color-white-7)' }"
/>
<span> {{ currentLive?.liveOwner.userName || currentLive?.liveOwner.userId }}</span>
<span class="header-name"> {{ currentLive?.liveOwner.userName || currentLive?.liveOwner.userId }}</span>
</template>
</div>
<div class="main-left-center">
Expand Down Expand Up @@ -303,9 +303,14 @@ async function handleJoinLive() {
color: $text-color1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include text-size-16;
}

.header-name {
max-width: 180px;
}

.icon-back {
max-width: 180px;
&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<TUIInput
v-model="form.liveName"
:placeholder="t('Please enter the live name')"
:maxLength="100"
:maxLength="30"
:spellcheck="false"
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions Web/web-vite-vue3/src/TUILiveKit/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const resource = {
Cancel: 'Cancel',
'Failed to create live': 'Failed to create live',
'Failed to update live settings': 'Failed to update live settings',
'The live name failed the security check. Please modify it and try again.': 'The live name failed the security check. Please modify it and try again.',
'No device detected': 'No device detected',
'No system permission': 'No system permission',
'Not support capture': 'Not support capture',
Expand Down
1 change: 1 addition & 0 deletions Web/web-vite-vue3/src/TUILiveKit/i18n/zh-CN/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const resource = {
Cancel: '取消',
'Failed to create live': '创建直播间失败',
'Failed to update live settings': '更新直播设置失败',
'The live name failed the security check. Please modify it and try again.': '直播间名称未通过安全检查,请修改后重试',
'No device detected': '未检测到设备',
'No system permission': '无系统权限',
'Not support capture': '不支持采集',
Expand Down
18 changes: 18 additions & 0 deletions Web/web-vite-vue3/src/TUILiveKit/types/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export enum LiveErrorCode {
// 101011 sub-errors (payment limits)
ROOM_MEMBER_COUNT_LIMIT = 40030,
ROOM_COUNT_LIMIT = 40031,

// Content security
NAME_SECURITY_CHECK_FAILED = 40040,
}

/**
Expand All @@ -64,6 +67,9 @@ export enum OriginalErrorCode {

// Payment limits
PAYMENT_LIMIT = 101011,

// Content security
GROUP_INFO_SECURE_CHECK_FAIL = 100026,
}

/**
Expand Down Expand Up @@ -152,4 +158,16 @@ export const ERROR_CODE_MAP: Record<number, ErrorParseResult> = {
code: LiveErrorCode.ROOM_ID_NOT_EXIST,
message: 'Room is not existed.',
},
[OriginalErrorCode.GROUP_INFO_SECURE_CHECK_FAIL]: {
code: LiveErrorCode.NAME_SECURITY_CHECK_FAILED,
message: 'The live name failed the security check. Please modify it and try again.',
},
};

/**
* Keys in this file's `message` fields double as i18n keys — the caller
* wraps them with `t(message)` before display. The i18n resource files
* (i18n/zh-CN, i18n/en-US) must contain matching entries. When a key
* is not found, `t()` falls back to the key itself (the English string),
* which is why every message is written in English here.
*/
24 changes: 24 additions & 0 deletions Web/web-vite-vue3/src/TUILiveKit/utils/errorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@ class ErrorHandler {
parseError(error: unknown): ErrorParseResult {
const raw = normalizeRawError(error);

// Some IM errors embed the code inside the message string
// (e.g. "error_code:100026, error_message:group info secure check fail!").
// Extract it so parseByKnownCode can match against ERROR_CODE_MAP.
// Use matchAll to collect every occurrence — a message may contain
// multiple error_code segments, and we want the first one that
// resolves to a known mapping rather than blindly taking the first.
if (raw.code === null || raw.code === undefined) {
const matches = typeof raw.message === 'string'
? [...raw.message.matchAll(/error_code:(\d+)/g)]
: [];
for (const match of matches) {
const code = Number(match[1]);
if (code in ERROR_CODE_MAP) {
raw.code = code;
break;
}
}
// Fall back to the first match if none mapped to a known code,
// so parseByKnownCode still gets a chance to report it.
if ((raw.code === null || raw.code === undefined) && matches.length > 0) {
raw.code = Number(matches[0][1]);
}
}

if (raw.code !== null && raw.code !== undefined) {
switch (raw.code) {
case OriginalErrorCode.PARAM_ILLEGAL:
Expand Down
2 changes: 1 addition & 1 deletion Web/web-vite-vue3/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApp } from 'vue';
import 'tuikit-atomicx-vue3/live';
import 'tuikit-atomicx-vue3';
import App from '@/App.vue';
import router from './router/index';

Expand Down