fix(route/twitter): add enable thirdparty api switcher
This commit is contained in:
parent
3e102d5a53
commit
b32c5ca07e
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue