refactor: move pixiv client_id and client_secret

This commit is contained in:
DIYgod 2019-09-03 11:57:47 +08:00
parent e7cab139fb
commit f25d17aa3f
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
6 changed files with 7 additions and 9 deletions

View File

@ -40,8 +40,6 @@ module.exports = {
},
nodeName: process.env.NODE_NAME,
pixiv: {
client_id: 'MOBrBDS8blbauoSck0ZfDbtuzpyT',
client_secret: 'lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj',
username: process.env.PIXIV_USERNAME,
password: process.env.PIXIV_PASSWORD,
},

View File

@ -4,7 +4,7 @@ const getUserDetail = require('./api/getUserDetail');
const config = require('@/config');
module.exports = async (ctx) => {
if (!config.pixiv || !config.pixiv.client_id || !config.pixiv.client_secret || !config.pixiv.username || !config.pixiv.password) {
if (!config.pixiv || !config.pixiv.username || !config.pixiv.password) {
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
}

View File

@ -33,7 +33,7 @@ const links = {
};
module.exports = async (ctx) => {
if (!config.pixiv || !config.pixiv.client_id || !config.pixiv.client_secret || !config.pixiv.username || !config.pixiv.password) {
if (!config.pixiv || !config.pixiv.username || !config.pixiv.password) {
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
}

View File

@ -4,7 +4,7 @@ const searchIllust = require('./api/searchIllust');
const config = require('@/config');
module.exports = async (ctx) => {
if (!config.pixiv || !config.pixiv.client_id || !config.pixiv.client_secret || !config.pixiv.username || !config.pixiv.password) {
if (!config.pixiv || !config.pixiv.username || !config.pixiv.password) {
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
}

View File

@ -10,8 +10,8 @@ const pixivConfig = config.pixiv;
let token = null;
const authorizationInfo = {
client_id: pixivConfig.client_id,
client_secret: pixivConfig.client_secret,
client_id: 'MOBrBDS8blbauoSck0ZfDbtuzpyT',
client_secret: 'lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj',
username: pixivConfig.username,
password: pixivConfig.password,
};
@ -94,7 +94,7 @@ async function tokenLoop() {
}
}
if (config.pixiv && config.pixiv.client_id && config.pixiv.client_secret && config.pixiv.username && config.pixiv.password) {
if (config.pixiv && config.pixiv.username && config.pixiv.password) {
tokenLoop();
}

View File

@ -3,7 +3,7 @@ const getIllusts = require('./api/getIllusts');
const config = require('@/config');
module.exports = async (ctx) => {
if (!config.pixiv || !config.pixiv.client_id || !config.pixiv.client_secret || !config.pixiv.username || !config.pixiv.password) {
if (!config.pixiv || !config.pixiv.username || !config.pixiv.password) {
throw 'pixiv RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#%E9%83%A8%E5%88%86-rss-%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE">relevant config</a>';
}