mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-13 16:49:31 +08:00
chore: bump got from 9.x to 10.x (#3875)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const got = require('@/utils/got');
|
||||
const config = require('@/config').value;
|
||||
const queryString = require('query-string');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const user = ctx.params.user;
|
||||
@@ -11,9 +12,9 @@ module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url,
|
||||
params: {
|
||||
searchParams: queryString.stringify({
|
||||
access_token: config.github && config.github.access_token,
|
||||
},
|
||||
}),
|
||||
});
|
||||
const data = response.data;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const got = require('@/utils/got');
|
||||
const config = require('@/config').value;
|
||||
const queryString = require('query-string');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const user = ctx.params.user;
|
||||
@@ -10,11 +11,11 @@ module.exports = async (ctx) => {
|
||||
const fileUrl = `https://github.com/${user}/${repo}/commits/${branch}/${filepath}`;
|
||||
|
||||
const res = await got.get(`https://api.github.com/repos/${user}/${repo}/commits`, {
|
||||
params: {
|
||||
searchParams: queryString.stringify({
|
||||
sha: branch,
|
||||
path: filepath,
|
||||
access_token: config.github && config.github.access_token,
|
||||
},
|
||||
}),
|
||||
});
|
||||
const list = res.data;
|
||||
const count = [];
|
||||
|
||||
@@ -16,8 +16,7 @@ module.exports = async (ctx) => {
|
||||
headers: {
|
||||
Authorization: `bearer ${config.github.access_token}`,
|
||||
},
|
||||
json: true,
|
||||
data: {
|
||||
json: {
|
||||
query: `
|
||||
{
|
||||
user(login: "${user}") {
|
||||
|
||||
@@ -3,6 +3,7 @@ const config = require('@/config').value;
|
||||
const md = require('markdown-it')({
|
||||
html: true,
|
||||
});
|
||||
const queryString = require('query-string');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const user = ctx.params.user;
|
||||
@@ -16,12 +17,12 @@ module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url,
|
||||
params: {
|
||||
searchParams: queryString.stringify({
|
||||
state: state,
|
||||
labels: labels,
|
||||
sort: 'created',
|
||||
access_token: config.github && config.github.access_token,
|
||||
},
|
||||
}),
|
||||
});
|
||||
const data = response.data;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ const config = require('@/config').value;
|
||||
const md = require('markdown-it')({
|
||||
html: true,
|
||||
});
|
||||
const queryString = require('query-string');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const user = ctx.params.user;
|
||||
@@ -15,10 +16,10 @@ module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url,
|
||||
params: {
|
||||
searchParams: queryString.stringify({
|
||||
sort: 'created',
|
||||
access_token: config.github && config.github.access_token,
|
||||
},
|
||||
}),
|
||||
});
|
||||
const data = response.data;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const got = require('@/utils/got');
|
||||
const config = require('@/config').value;
|
||||
const queryString = require('query-string');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const user = ctx.params.user;
|
||||
@@ -7,10 +8,10 @@ module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `https://api.github.com/users/${user}/repos`,
|
||||
params: {
|
||||
searchParams: queryString.stringify({
|
||||
sort: 'created',
|
||||
access_token: config.github && config.github.access_token,
|
||||
},
|
||||
}),
|
||||
});
|
||||
const data = response.data;
|
||||
ctx.state.data = {
|
||||
|
||||
@@ -17,8 +17,7 @@ module.exports = async (ctx) => {
|
||||
headers: {
|
||||
Authorization: `bearer ${config.github.access_token}`,
|
||||
},
|
||||
json: true,
|
||||
data: {
|
||||
json: {
|
||||
query: `
|
||||
{
|
||||
repository(owner: "${user}", name: "${repo}") {
|
||||
|
||||
@@ -16,8 +16,7 @@ module.exports = async (ctx) => {
|
||||
headers: {
|
||||
Authorization: `bearer ${config.github.access_token}`,
|
||||
},
|
||||
json: true,
|
||||
data: {
|
||||
json: {
|
||||
query: `
|
||||
{
|
||||
user(login: "${user}") {
|
||||
|
||||
Reference in New Issue
Block a user