fix build failed on post external slug

This commit is contained in:
tangly1024.com
2024-02-02 11:32:27 +08:00
parent 464c3add92
commit f568bc32ec
4 changed files with 14 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ export const memorize = (Component) => {
// 转换外链
export function sliceUrlFromHttp(str) {
// 检查字符串是否包含http
if (str.includes('http')) {
if (str.includes('http:') || str.includes('https:')) {
// 如果包含找到http的位置
const index = str.indexOf('http');
// 返回http之后的部分
@@ -48,7 +48,7 @@ export function sliceUrlFromHttp(str) {
// 检查是否外链
export function checkContainHttp(str) {
// 检查字符串是否包含http
if (str.includes('http')) {
if (str.includes('http:') || str.includes('https:')) {
// 如果包含找到http的位置
return str.indexOf('http') > -1
} else {