diff --git a/config/tools.yaml b/config/tools.yaml index 2bae13c..29f6bba 100644 --- a/config/tools.yaml +++ b/config/tools.yaml @@ -6,7 +6,7 @@ translateAppId: '' # 百度翻译APP ID translateSecret: '' # 百度翻译密匙 biliSessData: '' # 哔哩哔哩的SESSDATA -biliIntroLenLimit: 50 # 哔哩哔哩简介长度限制 +biliIntroLenLimit: 50 # 哔哩哔哩简介长度限制,填 0 或者 -1 可以不做任何限制,显示完整简介 biliDuration: 480 # 哔哩哔哩限制的最大视频时长(默认8分钟),单位:秒 douyinCookie: '' # douyin's cookie, 格式:odin_tt=xxx;sessionid_ss=xxx;ttwid=xxx;passport_csrf_token=xxx;msToken=xxx; \ No newline at end of file diff --git a/guoba.support.js b/guoba.support.js index bb5ed63..48d4ed6 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -105,7 +105,7 @@ export function supportGuoba() { component: "Input", required: false, componentProps: { - placeholder: "请输入哔哩哔哩的简介长度限制(默认50个字符)", + placeholder: "请输入哔哩哔哩的简介长度限制(默认50个字符),填 0 或者 -1 可以不做任何限制,显示完整简介", }, }, { diff --git a/utils/common.js b/utils/common.js index 6c69917..c214e75 100644 --- a/utils/common.js +++ b/utils/common.js @@ -287,7 +287,9 @@ export function containsChineseOrPunctuation(str) { * @returns {*|string} */ export function truncateString(inputString, maxLength = 50) { - if (inputString.length <= maxLength) { + if (maxLength === 0 || maxLength === -1) { + return inputString; + } else if (inputString.length <= maxLength) { return inputString; } else { // 截取字符串,保留前面 maxLength 个字符