File tree Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " laravel-frontend-file-manager" ,
3- "version" : " 3.0.53 " ,
3+ "version" : " 3.0.68 " ,
44 "description" : " File manager for Laravel" ,
55 "keywords" : [
66 " laravel" ,
Original file line number Diff line number Diff line change @@ -133,10 +133,11 @@ export default {
133133 let settings = localstore .getStorage (localstore .axiosSettingType );
134134
135135 if (settings) {
136- HTTP .interceptors .request .use ( async config => {
136+ HTTP .interceptors .request .use (config => {
137137 config .baseURL = settings .baseURL ;
138138 config .withCredentials = settings .withCredentials ;
139139 config .headers = settings .headers ;
140+ config .headers .common .Authorization = ` Bearer ${ window .localStorage .getItem (' _token' )} ` ;
140141
141142 return config;
142143 }, error => Promise .reject (error)
Original file line number Diff line number Diff line change 11import HTTP from './axios' ;
22
33export default {
4+ async getToken ( ) {
5+ return new Promise ( resolve => {
6+ resolve ( window . localStorage . getItem ( '_token' ) ) ;
7+ } ) ;
8+ } ,
49 /**
510 * Get configuration data from server
611 * @returns {* }
712 */
813 // Mohammad Ashrafuddin Ferdousi : 1
9- initialize ( ) {
10- return HTTP . get ( `initialize?token=${ window . localStorage . getItem ( '_token' ) } ` ) ;
14+ async initialize ( ) {
15+ let token = await this . getToken ( ) ;
16+ return HTTP . get ( `initialize?token=${ token } ` ) ;
1117 } ,
1218
1319 /**
Original file line number Diff line number Diff line change @@ -89,7 +89,11 @@ export default {
8989 }
9090 } ) ;
9191 }
92+ } else {
93+ window . location . reload ( ) ;
9294 }
95+ } ) . catch ( err => {
96+ window . location . reload ( ) ;
9397 } ) ;
9498 } ,
9599
You can’t perform that action at this time.
0 commit comments