feat: update parameters

This commit is contained in:
DIYgod 2024-06-27 02:15:22 +08:00
parent 2f8c101bcf
commit 1bc8c0280d
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View File

@ -69,6 +69,7 @@ export const route: Route = {
},
day: {
description: '时间跨度',
default: '3',
options: [
{
value: '1',

View File

@ -11,10 +11,11 @@ export const route: Route = {
groupid: '豆瓣小组的 id',
type: {
description: '类型',
default: 'latest',
options: [
{
label: '最新',
value: '',
value: 'latest',
},
{
label: '最热',
@ -50,7 +51,7 @@ async function handler(ctx) {
const groupid = ctx.req.param('groupid');
const type = ctx.req.param('type');
const url = `https://www.douban.com/group/${groupid}/${type ? `?type=${type}` : ''}`;
const url = `https://www.douban.com/group/${groupid}/${type && type !== 'latest' ? `?type=${type}` : ''}`;
const response = await got({
method: 'get',
url,