-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from team-JMT/feature/group-list
Feature/group list
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import axios from 'axios'; | ||
|
||
import { nativeInfo } from '@utils/storage'; | ||
|
||
export const Instance = axios.create({ | ||
baseURL: 'https://api.jmt-matzip.dev', | ||
headers: { | ||
authorization: `Bearer eyJhbGciOiJIUzUxMiJ9.eyJhdXRoIjoiTUVNQkVSIiwiZW1haWwiOiJ0ZXN0QG5hdmVyLmNvbSIsImV4cCI6MTcwNzY0MjgzNH0.hQF0XNOcg6vYS-brtciaGd6eCbjJ1UmdN14sQbsqucJgDyslv4AeKLe0j71NH8aq0nVexBrhjm82rITFHPNTbA`, | ||
authorization: `Bearer ${nativeInfo.getData().accessToken}`, | ||
}, | ||
}); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
function makeStorage<T extends Record<string, any>>(initialValue: T) { | ||
let data = initialValue; | ||
|
||
return { | ||
setData: (nextData: T): void => { | ||
data = nextData; | ||
}, | ||
getData: (): T => data, | ||
}; | ||
} | ||
|
||
type LocationSearchData = { | ||
placeName: string; | ||
addressName: string; | ||
roadAddressName: string; | ||
x: string; | ||
y: string; | ||
}; | ||
type NativeInfo = { | ||
accessToken: string; | ||
userPosition: LocationSearchData; | ||
}; | ||
|
||
export const nativeInfo = makeStorage<NativeInfo>({ | ||
accessToken: | ||
'eyJhbGciOiJIUzUxMiJ9.eyJlbWFpbCI6InRlc3RAbmF2ZXIuY29tIiwiYXV0aCI6Ik1FTUJFUiIsImV4cCI6MTcxMDA4MjUxMX0.TChmWo1TeOtJZzeuHikhDJLdfKviTHkNVTFux5Up9_peKyFZKqIspuc3haVLhcSetOMdqIK3sCVi4iDyNFFu9Q', | ||
userPosition: { | ||
placeName: '', | ||
addressName: '', | ||
roadAddressName: '', | ||
x: '127.0596', | ||
y: '37.6633', | ||
}, //x,y값은 임시입니당 | ||
}); |