laravel-request 1.2.23 → 1.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/Api.d.ts +1 -0
- package/package.json +1 -1
- package/src/Api.js +4 -1
package/@types/Api.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ declare module 'laravel-request' {
|
|
|
4
4
|
static requestClass: any;
|
|
5
5
|
static tokenResolver: () => Promise<string | null>;
|
|
6
6
|
static domainResolver: () => string;
|
|
7
|
+
static isDebug: () => string;
|
|
7
8
|
|
|
8
9
|
static getArg(controller: string, action: string, arg: any, data?: Record<string, any>): ApiRequest;
|
|
9
10
|
|
package/package.json
CHANGED
package/src/Api.js
CHANGED
|
@@ -22,7 +22,10 @@ export default class Api {
|
|
|
22
22
|
*/
|
|
23
23
|
static tokenResolver = async () =>
|
|
24
24
|
{
|
|
25
|
-
|
|
25
|
+
if(typeof window !== 'undefined' && typeof window.document !== 'undefined')
|
|
26
|
+
{
|
|
27
|
+
return window.localStorage.getItem('api_token');
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
/**
|