@rjgf/http-client
Advanced tools
Comparing version 0.1.39 to 0.1.40
@@ -17,2 +17,3 @@ import { AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
unauthorize: (err: HTTPError) => void; | ||
unjurisdiction: (err: HTTPError) => void; | ||
} | ||
@@ -111,3 +112,8 @@ export interface IHTTPClient extends EventEmitter<HTTPEventTypes> { | ||
private static isLoginFail; | ||
/** | ||
* 是否有权限(用来判断是否vip) | ||
* @param response | ||
*/ | ||
private static isJurisdiction; | ||
} | ||
export {}; |
@@ -124,2 +124,5 @@ "use strict"; | ||
} | ||
if (response && HTTPClient.isJurisdiction(response)) { | ||
this.emit('unjurisdiction', httpError); | ||
} | ||
this.emit('error', httpError); | ||
@@ -216,2 +219,9 @@ throw httpError; | ||
} | ||
/** | ||
* 是否有权限(用来判断是否vip) | ||
* @param response | ||
*/ | ||
static isJurisdiction(response) { | ||
return response.status === 403; | ||
} | ||
} | ||
@@ -218,0 +228,0 @@ exports.HTTPClient = HTTPClient; |
@@ -20,3 +20,3 @@ { | ||
], | ||
"gitHead": "64ffc73cfea01e6f7d2a2f13c0a961f15d0107f2", | ||
"gitHead": "f317fa081a3bd182a791e80a92477421e9eb7096", | ||
"license": "Apache-2.0", | ||
@@ -35,3 +35,3 @@ "main": "./dist/index.js", | ||
}, | ||
"version": "0.1.39" | ||
"version": "0.1.40" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32603
344