Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
bc128b98
Commit
bc128b98
authored
Aug 11, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tambahan
parent
4fddb389
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
index.js
src/api/index.js
+4
-3
No files found.
src/api/index.js
View file @
bc128b98
// a library to wrap and simplify api calls
// a library to wrap and simplify api calls
import
apisauce
from
'apisauce'
import
apisauce
from
'apisauce'
import
Constant
from
'../library/Constant'
// our "constructor"
// our "constructor"
const
create
=
(
baseURL
=
'https://trftia.eksad.com/tia-reporting-dev/public/'
)
=>
{
const
create
=
(
baseURL
=
'https://trftia.eksad.com/tia-reporting-dev/public/'
)
=>
{
...
@@ -25,13 +26,13 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
...
@@ -25,13 +26,13 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
api
.
addAsyncRequestTransform
(
request
=>
async
()
=>
{
api
.
addAsyncRequestTransform
(
request
=>
async
()
=>
{
var
token
var
token
try
{
try
{
// const res = await AsyncStorage.getItem("TOKEN"
)
const
res
=
await
localStorage
.
getItem
(
Constant
.
TOKEN
)
if
(
token
!=
null
)
{
if
(
token
!=
null
)
{
token
=
token
token
=
res
// alert(url)
// alert(url)
// api.setBaseURL(`${url}/api/`)
// api.setBaseURL(`${url}/api/`)
}
else
{
}
else
{
token
=
null
token
=
res
// url = Constant.BASE_URL.MASTER + '/api/'
// url = Constant.BASE_URL.MASTER + '/api/'
// alert(url)
// alert(url)
// api.setBaseURL(`${url}/api/`)
// api.setBaseURL(`${url}/api/`)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment