Skip to content

Commit

Permalink
Merge pull request #498 from fengyangsy/issue-#497
Browse files Browse the repository at this point in the history
Exclude auth token in register call

Fix #497
  • Loading branch information
yeasy committed Nov 19, 2022
2 parents fdd24f6 + 9d19f1a commit 68c791e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dashboard/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const request = extend({

request.interceptors.request.use(async (url, options) => {
const token = window.localStorage.getItem('cello-token');
if (token) {
if (url.indexOf('api/v1/login') < 0 && url.indexOf('api/v1/register') < 0 && token) {
// 如果有token 就走token逻辑
const headers = {
Authorization: `JWT ${token}`,
Expand All @@ -111,7 +111,7 @@ request.interceptors.request.use(async (url, options) => {
// 第一个拦截器有可能返回Promise,那么Promise由第二个拦截器处理
request.interceptors.request.use(async (url, options) => {
const token = localStorage.getItem('cello-token');
if (token) {
if (url.indexOf('api/v1/login') < 0 && url.indexOf('api/v1/register') < 0 && token) {
// 如果有token 就走token逻辑
const headers = {
Authorization: `JWT ${token}`,
Expand Down

0 comments on commit 68c791e

Please sign in to comment.