<fix>修复部分直播间不可链接的问题

- 增加了对 json数组 的转义替换(user-zd)
This commit is contained in:
skmcj committed 2023-09-06 12:23:48 +08:00
1 parent f28aff8e09
commit 82bc146a6e
2 files changed
+45

No files matched your search

+37
View File
@@ -10,6 +10,43 @@ import Left from './components/Left.vue';
import Right from './components/Right.vue';
import { ref, reactive, provide, readonly } from 'vue';
/**
* 输出标签
* @param tip
* @param link
* @param color
*/
const printInfo = function (
tip: string = '抖音弹幕姬',
link: string = 'https://github.com/skmcj/dycast',
color: string = '#dc6b82'
) {
console.log(
`%c ${tip} %c ${link}`,
`color:white;background:${color};padding:5px 0;border-radius: 5px 0 0 5px;`,
`padding:4px;border:1px solid ${color};border-radius: 0 5px 5px 0;`
);
};
const printSKMCJ = function () {
const info = `
________ ___ __ _____ ______ ________ ___
|\\ ____\\|\\ \\|\\ \\ |\\ _ \\ _ \\|\\ ____\\ |\\ \\
\\ \\ \\___|\\ \\ \\/ /|\\ \\ \\\\\\__\\ \\ \\ \\ \\___| \\ \\ \\
\\ \\_____ \\ \\ ___ \\ \\ \\\\|__| \\ \\ \\ \\ __ \\ \\ \\
\\|____|\\ \\ \\ \\\\ \\ \\ \\ \\ \\ \\ \\ \\ \\____ |\\ \\\\_\\ \\
____\\_\\ \\ \\__\\\\ \\__\\ \\__\\ \\ \\__\\ \\_______\\ \\________\\
|\\_________\\|__| \\|__|\\|__| \\|__|\\|_______|\\|________|
\\|_________|
`;
console.log(`%c${info}`, `color: #dc6b82`);
};
setTimeout(() => {
console.clear();
printSKMCJ();
printInfo();
}, 1500);
// 弹幕表
const chatList = reactive<Mess[]>([]);
// 点赞送礼榜
+8
View File
@@ -24,6 +24,14 @@ export const getRoomInfoApi = function (roomNumber: string) {
{
reg: /\}"/g,
str: '}'
},
{
reg: /"\[/g,
str: '['
},
{
reg: /\]"/g,
str: ']'
}
];
if (!matchRes) throw new Error('房间信息获取失败');