fix: baseURL to baseUrl

This commit is contained in:
DIYgod 2019-06-05 10:47:57 +08:00
parent 27d324b6e6
commit a47f2bd329
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
4 changed files with 10 additions and 10 deletions

View File

@ -3,7 +3,7 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
baseURL: 'https://cn.bing.com',
baseUrl: 'https://cn.bing.com',
url: '/HPImageArchive.aspx',
params: {
format: 'js',

View File

@ -3,11 +3,11 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const { period = '1d' } = ctx.params;
const baseURL = ctx.path.startsWith('/konachan.net') ? 'https://konachan.net' : 'https://konachan.com';
const baseUrl = ctx.path.startsWith('/konachan.net') ? 'https://konachan.net' : 'https://konachan.com';
const response = await got({
method: 'get',
baseURL,
baseUrl,
url: '/post/popular_recent.json',
params: {
period,
@ -27,7 +27,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${title} - Konachan Anime Wallpapers`,
link: `${baseURL}/post/popular_recent`,
link: `${baseUrl}/post/popular_recent`,
item: posts.map((post) => {
const content = (url) => {
if (url.startsWith('//')) {
@ -38,7 +38,7 @@ module.exports = async (ctx) => {
result += `<a href="${post.source}">source</a>`;
}
if (post.parent_id) {
result += `<a href="${baseURL}/post/show/${post.parent_id}">parent</a>`;
result += `<a href="${baseUrl}/post/show/${post.parent_id}">parent</a>`;
}
return result;
};
@ -49,7 +49,7 @@ module.exports = async (ctx) => {
title: post.tags,
id: `${ctx.path}#${post.id}`,
guid: `${ctx.path}#${post.id}`,
link: `${baseURL}/post/show/${post.id}`,
link: `${baseUrl}/post/show/${post.id}`,
author: post.author,
published: new Date(created_at).toISOString(),
pubDate: new Date(created_at).toUTCString(),

View File

@ -11,7 +11,7 @@ module.exports = async (ctx) => {
const response = await got({
method: 'get',
baseURL: 'http://update.miui.com',
baseUrl: 'http://update.miui.com',
url: '/updates/miota-fullrom.php',
params: {
d: device,

View File

@ -6,10 +6,10 @@ const map = new Map([[1, { title: '南京理工大学研究生院 -- 通知公
module.exports = async (ctx) => {
const type = Number.parseInt(ctx.params.type);
const id = map.get(type).id;
const baseURL = 'http://gs.njust.edu.cn';
const baseUrl = 'http://gs.njust.edu.cn';
const res = await got({
method: 'get',
url: baseURL + id + '/list.htm',
url: baseUrl + id + '/list.htm',
headers: {
Referer: 'https://gs.njust.edu.cn/',
},
@ -28,7 +28,7 @@ module.exports = async (ctx) => {
return {
title: item.find('a').text(),
link: `${baseURL + $(item.find('a')).attr('href')}`,
link: `${baseUrl + $(item.find('a')).attr('href')}`,
pubDate: new Date(item.find('.Article_PublishDate').text()).toUTCString(),
};
})