diff --git a/web/src/views/SitePages.vue b/web/src/views/SitePages.vue index de1fe36..b9a29ee 100644 --- a/web/src/views/SitePages.vue +++ b/web/src/views/SitePages.vue @@ -137,6 +137,14 @@ const sites = ref([]), pagesMap = ref({}), sitesList = ref([]) const editSiteId = ref(''), editorJson = ref('{}'), originalJson = ref('') const snapshotStatus = ref(null) const authType = ref('NONE') +const defaultUrls = { + sync: '/index.php', + signIn: '/attendance.php', + search: '/torrents.php?search={keyword}', + download: '/download.php?id={id}', + rss: '/torrentrss.php?rows=10&search={keyword}&search_mode=1&linktype=dl&passkey={passkey}', + detail: '/details.php?id={id}', +} const defaultTypes = ['nexusphp','mtorrent','gazelle','unit3d'] const isDefaultEditor = computed(() => editSiteId.value.startsWith('default:')) const pageKeys = ref([]) @@ -243,9 +251,9 @@ const editPage = async (row) => { const data = r?.data || r authType.value = data?.authType || 'NONE' const existing = data?.entries || [] - // 无配置则默认初始化所有页面类型 + // 无配置则默认初始化所有页面类型(带默认URL) const entries = existing.length ? existing - : pageKeys.value.map(k => ({ key: k.key, method: k.defaultMethod || 'GET', url: '' })) + : pageKeys.value.map(k => ({ key: k.key, method: k.defaultMethod || 'GET', url: defaultUrls[k.key] || '' })) editorJson.value = JSON.stringify({ authType: authType.value, entries }, null, 2) } catch { editorJson.value = JSON.stringify({ authType:'NONE', entries:[] }, null, 2) } originalJson.value = editorJson.value @@ -299,7 +307,7 @@ const discardDraft = async () => { const remove = (idx) => { parsed.value.splice(idx,1); syncToJson() } const addEntryByKey = (k) => { - parsed.value.push({ key: k.key, method: k.defaultMethod || 'GET', url: '' }) + parsed.value.push({ key: k.key, method: k.defaultMethod || 'GET', url: defaultUrls[k.key] || '' }) syncToJson() } const deletePages = async () => {