This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
status, | |
} = await axios.get(`/foo/${id}`, { | |
validateStatus: status => status === 200 || status === 404, | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add a response interceptor | |
axios.interceptors.response.use(function (response) { | |
// Any status code that lie within the range of 2xx cause this function to trigger | |
// Do something with response data | |
return { | |
...response, | |
data: humps.camelizeKeys(response.data), | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
async function getCycPool(address) { | |
const obj = {}; | |
const resultList = await Promise.allSettled([ | |
await axios.get('https://api.bscscan.com/api?module=proxy&action=eth_call&to=0x9634cfd96f1499990695ebbc081b4ee8d63d2e12&data=0902f1ac&tag=latest'), | |
await axios.get('https://api.bscscan.com/api?module=proxy&action=eth_call&to=0x9634cfd96f1499990695ebbc081b4ee8d63d2e12&data=18160ddd&tag=latest'), | |
await axios.get(`https://api.bscscan.com/api?module=proxy&action=eth_call&to=0x567da514637cfd7f9e1f185ae4aa163b3ebb5363&data=0xf40f0f52000000000000000000000000${address.replace(/^0x/, '')}&tag=latest`), | |
await axios.get(` https://api.bscscan.com/api?module=proxy&action=eth_call&to=0x567da514637cfd7f9e1f185ae4aa163b3ebb5363&data=0x1959a002000000000000000000000000${address.replace(/^0x/, '')}&tag=latest`), | |
await axios.get('https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=cyclone-protocol'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /page/home.jsx */ | |
import { getAxios } from '@util/axios' | |
const Home = ({ user }) => { | |
return ( | |
<h1>{user.name}</h1> | |
) | |
} | |
Home.getServerSideProps = async ({ req }) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /page/home.jsx */ | |
import axios from '@util/axios' | |
const Home = ({ user }) => { | |
return ( | |
<h1>{user.name}</h1> | |
) | |
} | |
Home.getServerSideProps = async ({ req }) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /page/home.jsx */ | |
import { useState, useEffect } from 'react' | |
import axios from '@util/axios' | |
const Home = () => { | |
const [user, setUser] = useState({}) | |
useEffect(async () => { | |
const { data } = await axios.get('https://mock.bugfree.app/api/me') | |
setUser(data) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface VIGP2API() | |
{ | |
AnGooGeneralCallbackBlock _callBack; | |
} | |
@property AnGooGeneralCallbackBlock PushMsgCallbackBlock; | |
@end | |
static TIAESCipher *_sgAesEngineObj = nil; | |
@implementation VIGP2API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface LoginVC () <UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> | |
{ | |
UserController *_uco; | |
RegisterNC *_rNC; | |
MBProgressHUD *_hud; | |
LoginUserIdTVC* _tvcUserId; | |
LoginPasswdTVC* _tvcPasswd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NS_ASSUME_NONNULL_BEGIN | |
@interface UserController : NSObject | |
+(UserController*)sigleton; | |
//Login | |
- (void) userLoginWithAccountId:(NSString*)accId | |
passwd:(NSString*)passwd | |
socialType:(NSString*)socialType //N:None; FB:facebook; G:GSI | |
completion:(GeneralCallbackBlock)completion; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UserController() | |
{ | |
dispatch_semaphore_t _sema_use_log; | |
} | |
@end | |
static UserController *_sguco = nil; | |
@implementation UserController |
NewerOlder