{"record":{"id":"b31ab59caea252be","repo":"PanJiaChen/vue-admin-template","slug":"50008","errorCode":"50008","errorMessage":"You have been logged out, you can cancel to stay on this page, or log in again","messagePattern":"You have been logged out, you can cancel to stay on this page, or log in again","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/utils/request.js","lineNumber":59,"sourceCode":"   * Determine the request status by custom code\n   * Here is just an example\n   * You can also judge the status by HTTP Status Code\n   */\n  response => {\n    const res = response.data\n\n    // if the custom code is not 20000, it is judged as an error.\n    if (res.code !== 20000) {\n      Message({\n        message: res.message || 'Error',\n        type: 'error',\n        duration: 5 * 1000\n      })\n\n      // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;\n      if (res.code === 50008 || res.code === 50012 || res.code === 50014) {\n        // to re-login\n        MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {\n          confirmButtonText: 'Re-Login',\n          cancelButtonText: 'Cancel',\n          type: 'warning'\n        }).then(() => {\n          store.dispatch('user/resetToken').then(() => {\n            location.reload()\n          })\n        })\n      }\n      return Promise.reject(new Error(res.message || 'Error'))\n    } else {\n      return res\n    }\n  },\n  error => {\n    console.log('err' + error) // for debug\n    Message({\n      message: error.message,","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/PanJiaChen/vue-admin-template/blob/4c18a3f47bdb417ad8a25f09910f848cb574dee2/src/utils/request.js#L41-L77","documentation":"Re-login confirmation dialog shown when the API returns business code 50008 (illegal token), 50012 (logged in from another client), or 50014 (token expired); it fires because the auth token was rejected by the server and the user must re-authenticate.","triggerScenarios":"Thrown at src/utils/request.js:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log in again via the confirm dialog to obtain a fresh token","If 50012, log out from the other client/session that invalidated this token","Check token expiration handling and consider silent refresh to avoid the dialog"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c18a3f47bdb417ad8a25f09910f848cb574dee2","analyzedAt":"2026-09-02T02:49:53.558Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}