feat: update parameters
This commit is contained in:
parent
2f8c101bcf
commit
1bc8c0280d
|
|
@ -69,6 +69,7 @@ export const route: Route = {
|
|||
},
|
||||
day: {
|
||||
description: '时间跨度',
|
||||
default: '3',
|
||||
options: [
|
||||
{
|
||||
value: '1',
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue