feat: add qlrepo sync crontab -- fix lint error

This commit is contained in:
engigu
2026-03-19 11:19:59 +08:00
parent cd818f7b0c
commit 4ffe09993c
2 changed files with 7 additions and 34 deletions
+4 -4
View File
@@ -212,9 +212,9 @@ function submitQlImport() {
// form task name
let name = '同步 '
try {
const urlPaths = args[2].split('/')
if (urlPaths.length > 0) {
name += urlPaths[urlPaths.length - 1].replace('.git', '')
const urlPaths = args[2]?.split('/')
if (urlPaths && urlPaths.length > 0) {
name += urlPaths[urlPaths.length - 1]?.replace('.git', '') || ''
} else {
name += '未命名仓库'
}
@@ -372,7 +372,7 @@ async function loadAgents() {
async function save() {
if (repoConfig.value.auto_add_cron) {
if (selectedLangs.value.length === 0 || !selectedLangs.value[0].name) {
if (selectedLangs.value.length === 0 || !selectedLangs.value[0]?.name) {
toast.error('您开启了“自动添加任务”,请先至少添加并选择一个运行语言环境和版本')
return
}