refactor: move pixiv client_id and client_secret
This commit is contained in:
parent
e7cab139fb
commit
f25d17aa3f
|
|
@ -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,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue