mirror of
https://github.com/sergeyyarkov/educt-client.git
synced 2026-10-11 18:29:15 +03:00
fix: api service
This commit is contained in:
parent
4fd3d65903
commit
05b79a0875
@ -6,9 +6,12 @@ export default class ApiService {
|
|||||||
|
|
||||||
public api: AxiosInstance;
|
public api: AxiosInstance;
|
||||||
|
|
||||||
|
public config: AxiosRequestConfig | undefined;
|
||||||
|
|
||||||
constructor(root: RootStore, config?: AxiosRequestConfig | undefined) {
|
constructor(root: RootStore, config?: AxiosRequestConfig | undefined) {
|
||||||
this.root = root;
|
this.root = root;
|
||||||
this.api = axios.create(config);
|
this.config = config;
|
||||||
|
this.api = axios.create(this.config);
|
||||||
this.setupInterceptors();
|
this.setupInterceptors();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,8 +32,4 @@ export default class ApiService {
|
|||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get config(): AxiosRequestConfig | undefined {
|
|
||||||
return this.config;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,10 +14,6 @@ export default class AuthStore {
|
|||||||
makeAutoObservable(this);
|
makeAutoObservable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
get getToken(): string | null {
|
|
||||||
return this.token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public setIsLoggedIn(value: boolean) {
|
public setIsLoggedIn(value: boolean) {
|
||||||
Cookies.remove('logged_in');
|
Cookies.remove('logged_in');
|
||||||
this.isLoggedIn = value;
|
this.isLoggedIn = value;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user