|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
const DEV_URL = '/dev_api'
|
|
|
|
|
const PROD_URL = 'https://shop.softwarrior.ru:8090'
|
|
|
|
|
const PROD_URL = 'https://shop.softwarrior.ru:8091'
|
|
|
|
|
|
|
|
|
|
export type ResponseData = {
|
|
|
|
|
error?: string
|
|
|
|
|
@ -7,12 +7,11 @@ export type ResponseData = {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type HeaderType = HeadersInit & {
|
|
|
|
|
authorization: string
|
|
|
|
|
authorization?: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const DEFAULT_HEADERS: HeaderType = {
|
|
|
|
|
'content-type': 'application/json',
|
|
|
|
|
authorization: '',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface NetworkApi {
|
|
|
|
|
@ -48,7 +47,7 @@ class Network implements NetworkApi {
|
|
|
|
|
if (value) {
|
|
|
|
|
this._headers.authorization = `Bearer ${value}`
|
|
|
|
|
} else {
|
|
|
|
|
this._headers.authorization = ''
|
|
|
|
|
this._headers.authorization = undefined
|
|
|
|
|
}
|
|
|
|
|
this._token = value
|
|
|
|
|
}
|
|
|
|
|
|