@@ -6,28 +6,28 @@ import { getBridgeSender } from '@/shared/lib/app-bridge/bridgeSender';
66export { RestAPI } from './rest' ;
77export type { RestAPIConfig , RestAPIProtocol } from './types' ;
88
9- const defaultJsonInstance = ( baseURL : string ) =>
10- new RestAPIInstance ( baseURL , {
11- withCredentials : false ,
12- authHeader : ( ) => {
13- if ( typeof window === 'undefined' ) return null ;
14- const token = sessionStorage . getItem ( 'accessToken' ) ;
15- return token ? { Authorization : `Bearer ${ token } ` } : null ;
16- } ,
17- bridgeSend : msg => getBridgeSender ( ) ?.( msg ) ,
18- } ) ;
19-
209// const defaultJsonInstance = (baseURL: string) =>
2110// new RestAPIInstance(baseURL, {
2211// withCredentials: false,
2312// authHeader: () => {
2413// if (typeof window === 'undefined') return null;
25- // const token =
26- // 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzMiIsIm1lbWJlcklkIjoiMzIiLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJpYXQiOjE3NTUwMDM4NTQsImV4cCI6MTc1NzU5NTg1NH0.sXHpNsim8-nIUdCjnAcOIZGsg2gUo8rnpkBmN-z5dKU';
27- // return token ? { Authorization: `Bearer ${token.trim()}` } : null;
14+ // const token = sessionStorage.getItem('accessToken');
15+ // return token ? { Authorization: `Bearer ${token}` } : null;
2816// },
17+ // bridgeSend: msg => getBridgeSender()?.(msg),
2918// });
3019
20+ const defaultJsonInstance = ( baseURL : string ) =>
21+ new RestAPIInstance ( baseURL , {
22+ withCredentials : false ,
23+ authHeader : ( ) => {
24+ if ( typeof window === 'undefined' ) return null ;
25+ const token =
26+ 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzMiIsIm1lbWJlcklkIjoiMzIiLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJpYXQiOjE3NTUwMDM4NTQsImV4cCI6MTc1NzU5NTg1NH0.sXHpNsim8-nIUdCjnAcOIZGsg2gUo8rnpkBmN-z5dKU' ;
27+ return token ? { Authorization : `Bearer ${ token . trim ( ) } ` } : null ;
28+ } ,
29+ } ) ;
30+
3131const formInstance = ( baseURL : string ) =>
3232 new RestAPIInstance ( baseURL , {
3333 withCredentials : false ,
0 commit comments