fix(route/twitter): add enable thirdparty api switcher

This commit is contained in:
pseudoyu 2024-11-29 14:59:44 +08:00
parent 3e102d5a53
commit b32c5ca07e
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import mobileApi from './mobile-api/api';
import webApi from './web-api/api';
import { config } from '@/config';
const enableThirdPartyApi = config.twitter.thirdPartyApi;
const enableMobileApi = config.twitter.username && config.twitter.password;
const enableWebApi = config.twitter.authToken;
@ -35,7 +36,9 @@ let api: {
getHomeLatestTimeline: () => null,
};
if (enableWebApi) {
if (enableThirdPartyApi) {
api = webApi;
} else if (enableWebApi) {
api = webApi;
} else if (enableMobileApi) {
api = mobileApi;