Skip to content

Commit

Permalink
优化重新登录条件判断
Browse files Browse the repository at this point in the history
  • Loading branch information
jas0ncn committed Jun 17, 2018
1 parent 3528741 commit 370c955
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/request.js
Expand Up @@ -87,7 +87,7 @@ function request(options) {
var data = response.data;

var error, message;
if (data && data.code === -1) {
if ((data && data.code === -1) || response.statusCode === 401) {
Session.clear();
// 如果是登录态无效,并且还没重试过,会尝试登录后刷新凭据重新请求
if (!hasRetried) {
Expand Down

0 comments on commit 370c955

Please sign in to comment.