@@ -46,15 +46,16 @@ export default class httpClient {
46
46
this . axiosInstance = axios . create ( axiosConfig ) ;
47
47
48
48
this . axiosInstance . interceptors . request . use ( ( config ) => {
49
- if ( ! config . headers [ 'projectToken' ] ) {
49
+ if ( ! config . headers [ 'projectToken' ] && this . projectToken !== '' ) {
50
50
config . headers [ 'projectToken' ] = this . projectToken ;
51
- }
52
- config . headers [ 'projectName' ] = this . projectName ;
53
- if ( ! config . headers [ 'username' ] || config . headers [ 'username' ] === '' ) {
54
- config . headers [ 'username' ] = this . username ;
55
- }
56
- if ( ! config . headers [ 'accessKey' ] || config . headers [ 'accessKey' ] === '' ) {
57
- config . headers [ 'accessKey' ] = this . accessKey ;
51
+ } else if ( ( ! config . headers [ 'projectName' ] && this . projectName !== '' ) ) {
52
+ config . headers [ 'projectName' ] = this . projectName ;
53
+ if ( ! config . headers [ 'username' ] || config . headers [ 'username' ] === '' ) {
54
+ config . headers [ 'username' ] = this . username ;
55
+ }
56
+ if ( ! config . headers [ 'accessKey' ] || config . headers [ 'accessKey' ] === '' ) {
57
+ config . headers [ 'accessKey' ] = this . accessKey ;
58
+ }
58
59
}
59
60
return config ;
60
61
} ) ;
@@ -158,10 +159,15 @@ export default class httpClient {
158
159
let authResult = 1 ;
159
160
let userName = '' ;
160
161
let passWord = '' ;
161
- if ( ctx . config . tunnel && ctx . config . tunnel ?. user && ctx . config . tunnel ?. key ) {
162
- userName = ctx . config . tunnel . user
163
- passWord = ctx . config . tunnel . key
164
- }
162
+ if ( ctx . config . tunnel ) {
163
+ if ( ctx . config . tunnel ?. user && ctx . config . tunnel ?. key ) {
164
+ userName = ctx . config . tunnel . user
165
+ passWord = ctx . config . tunnel . key
166
+ } else {
167
+ userName = this . username
168
+ passWord = this . accessKey
169
+ }
170
+ }
165
171
if ( this . projectToken ) {
166
172
authResult = 0 ;
167
173
}
0 commit comments