增加自定义脚本名字长度
parent
001eba6729
commit
68518e609d
|
@ -66,6 +66,7 @@ const handleRequest = (context, { requestKey, data }) => {
|
|||
*
|
||||
* @param {*} context
|
||||
* @param {*} info {
|
||||
* openDevTools: false,
|
||||
* status: true,
|
||||
* message: 'xxx',
|
||||
* sources: {
|
||||
|
|
|
@ -19,9 +19,9 @@ exports.importApi = script => {
|
|||
let name = scriptInfo[1] || ''
|
||||
let description = scriptInfo[2] || ''
|
||||
name = name.startsWith(' * @name ') ? name.replace(' * @name ', '').trim() : `user_api_${new Date().toLocaleString()}`
|
||||
if (name.length > 10) name = name.substring(0, 10) + '...'
|
||||
if (name.length > 24) name = name.substring(0, 24) + '...'
|
||||
description = description.startsWith(' * @description ') ? description.replace(' * @description ', '').trim() : ''
|
||||
if (description.length > 20) description = description.substring(0, 20) + '...'
|
||||
if (description.length > 36) description = description.substring(0, 36) + '...'
|
||||
const apiInfo = {
|
||||
id: `user_api_${Math.random().toString().substring(2, 5)}_${Date.now()}`,
|
||||
name,
|
||||
|
|
Loading…
Reference in New Issue